Difference between revisions of "VMD"

From Docswiki
Jump to navigation Jump to search
Line 11: Line 11:
 
To load all frames in one go, select the file type in the "Determine file type" box, and then the button "load all at once"
 
To load all frames in one go, select the file type in the "Determine file type" box, and then the button "load all at once"
 
will not be greyed out, so you can select it.
 
will not be greyed out, so you can select it.
  +
   
 
vmd movie making seems not work properly with step sizes different from one. The last frame is repeated many times. Instead, the
 
vmd movie making seems not work properly with step sizes different from one. The last frame is repeated many times. Instead, the
 
frames can be selected using sed:
 
frames can be selected using sed:
   
Try extracting frames first with sed:
+
Try extracting frames first with sed:
  +
sed -e '1~66087,+62939d' path.xyz > temp
+
sed -e '1~66087,+62939d' path.xyz > temp
1,+62939d deletes lines 1 to 62940, deleting 20 frames
 
  +
The ~66087 repeats the action every 21 frames. The counter operates on the original line numbers. This example is for a
 
 
1,+62939d deletes lines 1 to 62940, deleting 20 frames
  +
 
The ~66087 repeats the action every 21 frames. The counter operates on the original line numbers.
  +
  +
This example is for a
 
system with 3145 atoms, so each frame is 3147 lines with the xyz header.
 
system with 3145 atoms, so each frame is 3147 lines with the xyz header.
   
sed -e '1~Y,+Xd' path.xyz > temp
+
sed -e '1~Y,+Xd' path.xyz > temp
  +
1,+Xd deletes lines 1 to X+1, so to select every nth frame for frames of length m you need X=n*m-1
+
1,+Xd deletes lines 1 to X+1, so to select every nth frame for frames of length m you need
and Y=(n+1)*m
 
  +
  +
X=n*m-1
  +
 
and Y=(n+1)*m
  +
 
m is the number of atoms plus two.
 
m is the number of atoms plus two.
  +
  +
To make the movie pause at the start and finish, just duplicate these end points sufficiently. If there are
  +
slow portions around local minima try adjusting the energy difference parameter on the PATH line in the OPTIM odata file for intial
  +
generation of path.xyz.
   
   

Revision as of 09:53, 10 August 2021

VMD is a molecular visualization program installed on all workstations and clusters. The official documentation can be found here with some tutorials here. Like gnuplot however, the wealth of options means that often it takes a long time to find the one command you need to use so below you will find some useful basic settings/info for using VMD. For producing graphics for publication, Pymol is probably a better option as it has a built in ray-tracing routine but for general visualization, VMD is much quicker.

It is possible to load most files using command line flags, making loading many frames into different topology files easy. The -f flag indicates that all subsequent files (until the next -f flag or the end) should be loaded into a single molecule. There are also flags for selecting different file types (default is .pdb), most commonly parm7 for topology files generated by Amber and rst7 for restart files generated by Amber. mdcrd files are denoted -crd and periodic mdcrd files -crdbox.

e.g.

       vmd -f first_mol.pdb \
           -f -parm7 second_mol.prmtop -rst7 second_mol.rst \
           -f -parm7 third_mol.prmtop -crdbox third_mol_1st_frames.crd -crdbox third_mol_2nd_frames

Movie Making Tips

To load all frames in one go, select the file type in the "Determine file type" box, and then the button "load all at once" will not be greyed out, so you can select it.


vmd movie making seems not work properly with step sizes different from one. The last frame is repeated many times. Instead, the frames can be selected using sed:

Try extracting frames first with sed:

sed -e '1~66087,+62939d' path.xyz > temp

1,+62939d deletes lines 1 to 62940, deleting 20 frames

The ~66087 repeats the action every 21 frames. The counter operates on the original line numbers.

This example is for a system with 3145 atoms, so each frame is 3147 lines with the xyz header.

sed -e '1~Y,+Xd' path.xyz > temp

1,+Xd deletes lines 1 to X+1, so to select every nth frame for frames of length m you need

X=n*m-1

and Y=(n+1)*m

m is the number of atoms plus two.

To make the movie pause at the start and finish, just duplicate these end points sufficiently. If there are slow portions around local minima try adjusting the energy difference parameter on the PATH line in the OPTIM odata file for intial generation of path.xyz.


Tutorials