Atom selection macros can be defined using the macro method of the AtomSel module. The syntax is just as in the corresponding atomselect macro and atomselect delmacro Tcl commands; see section 8.3.2 for details.
Below we summarize the methods available from the AtomSel class.
sel = AtomSel('name CA', 1) # Selects the alpha carbons of molecule 1
sel.select('resid 5')
sel.frame(5)
sel.frame()
5
x, y, z = sel.get('x', 'y', 'z')
len(sel)
12
sel.set('beta',3)
sel.set('beta',(1,2,3,4,5,6,7,8,9,10,11,12))
Finds the transformation that aligns the atoms in the selection with the atoms in ref, with optional weights weight, and applies this transformation to the atoms in move. The following default values for all arguments are provided:
first timestep in the molecule.