The first question is, of course, whether the simulation has the information that you need. After all, if we can't discover that, then we've got a problem!
If we look at the analysis code itself, we can see that all it is actually doing is using the Z coordinate of the water molecules in each frame and ignoring the other coordinates (which would be required for estimating which pore was used). It decides what is going on with them using a tiny little state machine per molecule. The relevant code is this (after conventionalising the input):
for {set fr 0} {$fr < $numFrame} {incr fr} {
molinfo top set frame $fr
set oldList $labelList
set labelList {}
foreach z [$wat get z] oldLab $oldList segname $segList resid $ridList {
if {$z > $upperEnd} {
set newLab 2
if {$oldLab == -1} {
puts "$segname:$resid permeated through the nanotubes along +z direction at frame $fr"
if {$fr >= $skipFrame} {
incr num1
}
}
} elseif {$z < $lowerEnd} {
set newLab -2
if {$oldLab == 1} {
puts "$segname:$resid permeated through the nanotubes along -z direction at frame $fr"
if {$fr >= $skipFrame} {
incr num2
}
}
} elseif {abs($oldLab) > 1} {
set newLab [expr $oldLab / 2]
} else {
set newLab $oldLab
}
lappend labelList $newLab
}
}
Perhaps a start would be to collect the X and Y coordinates of the molecules immediately after the transit events and to plot those? I don't know if that will help, but maybe?
for {set fr 0} {$fr < $numFrame} {incr fr} {
molinfo top set frame $fr
set oldList $labelList
set labelList {}
foreach x [$wat get x] y [$wat get y] z [$wat get z] oldLab $oldList segname $segList resid $ridList {
if {$z > $upperEnd} {
set newLab 2
if {$oldLab == -1} {
puts "$segname:$resid permeated through the nanotubes along +z direction at frame $fr"
if {$fr >= $skipFrame} {
incr num1
}
# Remember event for later
lappend permeateUpwards $x $y
}
} elseif {$z < $lowerEnd} {
set newLab -2
if {$oldLab == 1} {
puts "$segname:$resid permeated through the nanotubes along -z direction at frame $fr"
if {$fr >= $skipFrame} {
incr num2
}
# Remember event for later
lappend permeateDownwards $x $y
}
} elseif {abs($oldLab) > 1} {
set newLab [expr $oldLab / 2]
} else {
set newLab $oldLab
}
lappend labelList $newLab
}
}
Now that we have those lists, we can try to print them to a file so that you can plot them:
set f [open "downwards.csv" w]
foreach {x y} $permeateDownwards {
puts $f "$x,$y"
}
close $f
set f [open "upwards.csv" w]
foreach {x y} $permeateUpwards {
puts $f "$x,$y"
}
close $f
There's plenty of tools that can plot a series of points in a CSV, and you can look at that and see if what you've got is at least reasonable.