0

My project is based on MD simulation analysis on a system containing water box and lipid bilayer containing Aquaporin embedded in it. Simulations of timestep 150 ns is performed on this system to study the analysis of water permeation and flow through the lipid bilayer. one of the analysis of my work demands the calculation of water permeation events through each channel of this embedded proteins (this protein contains four monomers forming four water channels). I am performing my analysis using VMD.

I got this script https://www.ks.uiuc.edu/Training/Tutorials/science/nanotubes/files/permeation.tcl surfing from the internet. But this script is not giving the results according to my requirement.

As I wanted to find out permeation events happening through each pore/water channel separately and this script just calculate the water permeation events through the AQP layer as a whole. I have not as much expertise to change this script according to my requirement.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
iqra khan
  • 45
  • 1
  • 6

1 Answers1

0

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.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
  • I'll leave labelling the points as an exercise. Indeed, there's a _lot_ more information you can recover by tracking the positions of the molecules over time. But checking if the basic information is available is vital or you'll never make head or tail of it. (I have assumed that the X and Y coordinates are simply available, but that seems like a reasonable guess to me.) – Donal Fellows Jul 02 '20 at 17:01
  • Also, if I was doing this for myself then I'd be looking at dumping all the labelling and positioning information into a database (e.g., SQLite) for greater tractability and transportability. – Donal Fellows Jul 02 '20 at 17:04