Extend cubic water box with VMD script.

I haven’t found better way than this, I used a long time to figure out how to do this efficiently. (Get help from http://www.ks.uiuc.edu/Research/vmd/plugins/topotools/)

The VMD script is below. It’s Tcl/Tk.

########################################

package require topotools 1.5

for {set i 0} {$i < 10} {incr i} {  #Set loop to read data every 10 frames
set mol [mol new PVCL100.prmtop waitfor all]  #Load the PRMTOP file
mol addfile 323.dcd first $i last $i  #Load the trajectory file
set newmol [::TopoTools::replicatemol $mol 1 2 1 ]  #Set the extension plan. 1 2 1 means extend one box at y direction.
animate write pdb $i.pdb $newmol  #Output the extended box to PDB
mol delete all  #Delete all data and loop to next frame
}

#########################################

You man change the PRMTOP to other format VMD can read files of a lot of other formats. And output can be DCD or MDCRD or other format. You may use CPPTRAJ to combine them and analyze with AMBERTOOLS. VMD can also do the analysis, but AMBERTOOLS is faster and easily combined with BASH script for batch jobs.

An important think for this change is to change the PRMTOP file correspondingly. It’s tricky, so I always use PDB. It’s easy to combine PDB to trajectory files. And I can use residue number to do analysis with VMD. Or it’s also possible to use a frame of extended PDB to generate new PRMTOP and then use AMBERTOOLS to deal with the extended DCD or MDCRD.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s