| atomSel | index atomSel.py |
select a subset of atoms
An atom selection consists of selection string and list of
corresponding atoms. The object emulates a Python sequence, so that
the selected atom.Atoms can be accessed through the [] operator.
The selection language is the XPLOR atom selection language.
Note, however, that the outer parentheses are not necessary in AtomSel
contruction.
Constructor:
AtomSel(string,simulation)
string is a selection string in the XPLOR selection language.
simulation is an optional simulation.Simulation specification.
It defaults to the current Simulation.
If there is an error in the selection string, an exception is raised.
methods:
string() return the selection string associated with this AtomSel.
simulation() return the simulation associated with the selection
indices() return list of atom indices associated with the selection
setIndices(list)
manually set the list of atom indices.
apply(apply_instance):
invoke apply_instance's run() function on
each atom in the selection. apply_instance is either
an instance of a class defined in the atomSelAction
module, or a user-defined class which derives from the
atomSelAction.PyAtomSelAction class. Please see
the documentation for the atomSelAction module for
more information.
reevaluate() some selections depend on mutable properties
like coordinates. This member reevaluates such a
selection.
containsIndex(index)
returns true if the selection includes the atom with the
specified index.
containsAtom(atom)
returns true if the selection includes the specified atom.
functions:
intersect(atomSel1,atomSel2)
evaluates whether two AtomSels select one or more of the same atoms
monomericallyEqual(atomSel1,atomSel2)
evaluate whether two AtomSels select atoms with the same resid,
resname, and atom names, ignoring any difference in segid.
minResidDiff(atomSel1,atomSel2)
returns minimum number of residues between atoms in two AtomSels
intersection(atomSel1,atomSel2)
returns an AtomSel whose indices() consists of the intersection of
those of atomSel1 and atomSel2. This AtomSel cannot be reevaluated.
union(atomSel1,atomSel2)
returns an AtomSel whose indices() consists of the union of
those of atomSel1 and atomSel2. This AtomSel cannot be reevaluated.
notSelection(sel)
returns an AtomSel whose indices() consists of all those argument sel's
Simulation but, not in its indices().
Example
print out positions of alpha carbons in residues 40-43, inclusive.
sel = AtomSel("name CA and resid 40:43")
for atom in sel:
print sel.pos()
| Classes | ||||||||||||||
|
| ||||||||||||||
| Functions | ||
| ||