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 § 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))