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
       
__builtin__.object
AtomSel
AtomSelPtr

 
class AtomSel(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_AtomSel>)
__eq__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__init__(self, *args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
apply(*args)
containsAtom(*args)
containsIndex(*args)
help(*args)
indices(*args)
ok(*args)
reevaluate(*args)
setIndices(*args)
simulation(*args)
size(*args)
string(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9360>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'AtomSel' objects>
list of weak references to the object (if defined)

 
class AtomSelPtr(AtomSel)
    
Method resolution order:
AtomSelPtr
AtomSel
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from AtomSel:
__del__(self, destroy=<built-in function delete_AtomSel>)
__eq__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
apply(*args)
containsAtom(*args)
containsIndex(*args)
help(*args)
indices(*args)
ok(*args)
reevaluate(*args)
setIndices(*args)
simulation(*args)
size(*args)
string(*args)

Data and other attributes inherited from AtomSel:
__dict__ = <dictproxy object at 0xee9280>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'AtomSel' objects>
list of weak references to the object (if defined)

 
Functions
       
asUnion(...)
help(...)
intersect(...)
intersection(...)
minResidDiff(...)
monomericallyEqual(...)
notSelection(...)
union = asUnion(...)