Next: trans
Up: Controlling VMD from Python
Previous: render
Contents
Index
topology
Python operations available from the topology module, used to query and set topological relations (bonds, angles, etc.) between atoms in a molecule.
For large-scale regeneration of angles and dihedrals given a bonded topology, use topotools via evaltcl, as shown below in an example script.
import topology
from VMD import evaltcl
#Load molecule here... (not shown)
#Delete existing angles and dihedrals
topology.delallangles()
topology.delalldihedrals()
topology.delallimpropers()
evaltcl("package require topotools; topo guessangles")
evaltcl("topo guessdihedrals; topo guessimpropers")
- bonds(molid=top, type=0):
Returns all unique bonds within the structure of the specified molid.
Each bond will be its own 2-element list within the list. Optionally,
the bond type and order can be returned by modifying the type parameter.
0=bond indexes only, 1 adds bond type information, 2 adds bond order, and 3 adds both.
- angles(molid=top, type=0):
Returns all unique angles within the structure of the specified molid.
Each angle will be its own 3-element list within the list. Optionally,
the angle type can be returned by modifying the type parameter.
0=angle indexes only, 1 adds angle type information.
- dihedrals(molid=top, type=0):
Returns all unique dihedrals within the structure of the specified molid.
Each dihedral will be its own 4-element list within the list. Optionally,
the dihedral type can be returned by modifying the type parameter.
0=dihedral indexes only, 1 adds dihedral type information.
- impropers(molid=top, type=0):
Returns all unique impropers within the structure of the specified molid.
Each improper will be its own 4-element list within the list. Optionally,
the improper type can be returned by modifying the type parameter.
0=improper indexes only, 1 adds improper type information.
- impropers(molid=top, type=0):
Returns all unique impropers within the structure of the specified molid.
Each improper will be its own 4-element list within the list. Optionally,
the improper type can be returned by modifying the type parameter.
0=improper indexes only, 1 adds improper type information.
- addbond(i, j, molid=top, order=1.0, type=None):
Adds one bond between the atoms at index i and j of the molecule given by molid,
with bondorder order and bondtype type. Bonds cannot be added twice, and will be ignored if present.
Returns 0 on success, -1 on failure.
- addangle(i, j, k, molid=top, type=None):
Adds one angle between the atoms at index i, j and k of the molecule given by molid,
with angletype type. Duplicates are not checked!!! Will return the index of the added angle.
- adddihedral(i, j, k, l, molid=top, type=None):
Adds one dihedral between the atoms at index i, j, k, and l of the molecule given by molid,
with dihedraltype type. Duplicates are not checked!!! Will return the index of the added dihedral.
- addimproper(i, j, k, l, molid=top, type=None):
Adds one improper between the atoms at index i, j, k, and l of the molecule given by molid, with type type. No duplicate checks are made. Will return the index of the added improper.
- delbond(i, j, molid=top):
Deletes bond between atoms i and j, if present. Method returns the number of bonds deleted (0 or 1).
- delangle(i, j, k, molid=top):
Deletes angle between atoms i, j, and k, if present. Method returns the number of angles deleted (0 or 1).
- deldihedral(i, j, k, l, molid=top):
Deletes dihedral between atoms i, j, k, and l, if present. Method returns the number of dihedrals deleted (0 or 1).
- delimproper(i, j, k, l, molid=top):
Deletes improper between atoms i, j, k, and l, if present. Method returns the number of impropers deleted (0 or 1).
- delallbonds(molid=top):
Deletes all bonds associated with a molid, returning the number of bonds deleted.
- delallangles(molid=top):
Deletes all angles associated with a molid, returning the number of angles deleted.
- delalldihedrals(molid=top):
Deletes all dihedrals associated with a molid, returning the number of dihedrals deleted.
- delallimpropers(molid=top):
Deletes all impropers associated with a molid, returning the number of impropers deleted.
Next: trans
Up: Controlling VMD from Python
Previous: render
Contents
Index
vmd@ks.uiuc.edu