Desmond Tutorial
Desmond Tutorial - DE Shaw Research
Desmond Tutorial - DE Shaw Research
- No tags were found...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Analyzing Trajectories Using VMD<br />
Getting information about snapshots<br />
molecule.read(molid, filetype='dtr', filename='trajectory,dtr', waitfor=-<br />
1)<br />
The —1 argument to molecule.read indicates that a new molecule should be created<br />
for the file. We specify filetype and filename to load the structure. Finally, we use the<br />
molid returned by the first read command as the first argument to the second read command<br />
so that data from the trajectory gets appended to the original structure file. The<br />
waitfor=-1 means to load all frames in the trajectory before returning from the call. This<br />
corresponds to the ‘Load all at once’ option in the File menu.<br />
You can also specify a range of frames to be loaded:<br />
molecule.read(molid, 'dtr', 'trajectory.dtr',<br />
beg=5, end=55, skip=10, waitfor=-1)<br />
Assuming there were at least 55 snapshots in trajectory.dtr, this command would<br />
load snapshots 5, 15, 25, 35, 45, and 55 into the molecule with the given molid.<br />
Getting information about snapshots<br />
Data in VMD is organized into Molecules, which represent entire molecular systems as<br />
well any number of snapshots associated with those systems. As molecules are loaded,<br />
they are assigned a integer key called a molid. Exactly one molecule at any given time is<br />
tagged as the top molecule; unless you set the top molecule yourself, this will always be<br />
the most recently loaded molecule.<br />
Each molecule in VMD has a fixed number of atoms. To each atom, VMD associates various<br />
attributes such as name, type, mass, charge, etc. This data is usually obtained from a<br />
structure file, but missing values not supplied by the structure file are guessed, and the<br />
stored values can be overridden using scripting commands as described below.<br />
The snapshots associated with each molecule are referred to as frames. Each frame holds<br />
one set of coordinates for each atom in the molecule, as well as unit cell dimensions for<br />
that frame. Velocities can also be stored if the trajectory file supplies them and the user<br />
requests it using the appropriate file type. Table 1 summarizes the functions in the molecule<br />
module for querying the high level structure of molecules in VMD.<br />
In the rest of this section, we outline the Python interface provided by VMD to extract<br />
atom and frame information from a molecule.<br />
Atom selections<br />
An atom selection consists of all the atoms in a particular molecule and frame that satisfy<br />
some predicate, or set of conditions. We often refer to the predicate as the selection, but it<br />
should be kept in mind that the set of atoms satisfying the predicate could be different for<br />
different frames. Atom selections are used in the GUI to select which atoms to draw with<br />
each style. The same selection language is used in the scripting interface to specify a predicate<br />
for an atom selection object.<br />
Atom selection objects are created in the VMD Python interface using the atomsel module:<br />
# Import the atomsel type<br />
from atomsel import atomsel<br />
# Create a selection corresponding to all atoms in the top molecule,<br />
September 2008 D. E. Shaw Research 89