Jump to content

Talk:Mod:Hunt Research Group/VmdScriptsMapCoMoverTraj

From ChemWiki

A script to draw the path of the centre of mass of a selection through an animation

  • the trajectory is taken from the DL_POLY HISTORY file,
if you need a demo file to practice on download this history file: Media:TEST_CUSO4_DLPOLY_HISTORY.rtf
once you have downloaded it remove the .rtf extension and save with the simple filename "HISTORY"
  • recentre the atom. We have to recentre the atom, if it is at the or near the edge of the box and we want to bring it to the centre.
  • open the DL_POLY HISTORY file and take the coordinates of the atom, e.g in the practice HISTORY file the Cu coordinate --> -1.1728E+01 9.7348E+00 1.8591E+00
  • to bring Cu to the centre of the box, run the command './recentre_xyz.py <INPUT FILE> <OUTPUT FILE> <X TRANS> <Y TRANS> <Z TRANS> (<UNIT CELL LENGTH>)' ,
with <X TRANS> <Y TRANS> <Z TRANS> as 1.1728E+01 -9.7348E+00 -1.8591E+00
  • Code to Recentre DL_PLOY HISTORY file link
  • convert the HISTORY file format to the multi-frame XYZ file
  • Link to the code to convert the DL_POLY HISTORY file to the multi-frame XYZ filelink
  • start VMD and load the file.xyz
  • you need to identify the atom or molecule you wish to follow.
  • To identify the atom or molecule to follow, load the DL_POLY HISTORY file in VMD, then click on Mouse and select Query. Then click on the atom you want to identify, it will give the name, type, index and residue number
  • there are now two options
the script to draw the path of the centre of mass of a molecule throughout an animation is trajectory_path.tcl link
first is to alter the script itself and then run it
for example type in "set water [atomselect top "resid 666"]" to define the water to follow and then run the script "trajectory_path $water"
if you don't want the defaults select a colour(yellow) line width(3)
the second is to define a variable and then run the script
at the bottom of the script are two lines commented out, uncomment and edit to the desired values
for example
set water [atomselect top "residue 666"]
trajectory_path $water
then reload the script, which will also run it " source trajectory_path.tcl"
you don't need to use residue you could use index or atom as selectors
  • OR if you are using cx1, you can open VMD and load the file all in one
first give the command to access the VMD program "load vmd"
then give a command to load the file.xyz and run the script on it "vmd -e trajectory_path.tcl <file_name>.xyz"
  • Dealing with bonding across the boundarylink