next up previous contents index
Next: The AtomSel class (DEPRECATED) Up: Atom selections in Python Previous: Atom selections in Python   Contents   Index

The built-in atomsel type

NEW IN VMD 1.8.6: The AtomSel class has been deprecated, in favor of a new built-in type called atomsel. The atomsel type functions much the same way as the old AtomSel class, but also provides methods similar to the Tcl interface for returning RMS fit matrices and applying those transformations to coordinates.

The new atomsel type is found in a new built-in module, also called atomsel. Use help(atomsel) to get the complete documentation, in addition to what is presented here. Largely, the methods duplicate what is available within the measure command within the Tcl interface.

A short example is given below:

>>> from atomsel import *
>>> s1 = atomsel('residue 1 to 10 and backbone')
>>> s1.get('resid')
>>> s1.set('beta', 5') # set B value to 5 for atoms in s1
>>> # Mass-weighted RMS alignment:
>>> mass = s1.get('mass')
>>> s2 = atomsel('residue 21 to 30 and backbone')
>>> mat = s1.fit(s2, mass)
>>> s1.move(mat)
>>> print s1.rmsd(s2)


next up previous contents index
Next: The AtomSel class (DEPRECATED) Up: Atom selections in Python Previous: Atom selections in Python   Contents   Index
vmd@ks.uiuc.edu