atomSel
index

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, or a subset thereof, can be accessed
through the Python [] operator.  The selection language is defined in
the atomSelLang module.  Note that the outer parentheses are not
necessary in AtomSel contruction.
 
 
Constructor:
 
  AtomSel(string, simulation, ordered=False)
    string is a selection string in the XPLOR selection language.
    simulation is an optional simulation.Simulation specification; 
    it defaults to the current Simulation. Normally AtomSels are use PSF
    order, i.e. the atoms are indexed in order of their index values. If
    the optional argument ordered is set to True, then the atoms will instead
    reflect the order specified by ``or'' statements in the selection 
    string. See the atomSelLang module documentation to read a description 
    of how order is preserved with overlapping selections. Do note that
    ordered selections are tricky as the order of keywords separated by
    ``and'' become significant.
 
    Alternatively the string argument can be replaced with a sequence of
    atom indices to manually generate an atom selection. In this case
    the ordered argument cannot be specified.
 
    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. This method returns the result of
                      calling the argument's returnMethodName() member, if
                      not an empty string.
 
        removeBySelIndex(index)
                      remove the index-th atom from this instance, where index
                      is 0 through one less than the number of atoms in this
                      instance.
   
        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)
                     return True if the selection includes the specified atom.
 
        allValid()   return False if any atoms are invalid. Otherwise, return
                     True.
 
        ordered()    whether or not the atoms use OR ordered. If this value is
                     changed, reevaluate() must be called to update the
                     object.
 
 
Functions:
 
   intersect(AtomSel1, AtomSel2)
       Evaluate whether the two AtomSels select one or more of the same atoms.
 
   equals(atomSel1, atomSel2)
      returns True if the two arguments contain the same atoms, regardless of 
      order. Python's __eq__ ( a == b ) returns equals(a,b)
 
   monomericallyEqual(AtomSel1, AtomSel2)
       Evaluate whether the two AtomSels select atoms with the same resid, 
       resname, and atom names, ignoring any difference in segid.
 
   minResidDiff(AtomSel1, AtomSel2)
       Return minimum number of residues between atoms in the two AtomSels.
 
   intersection(AtomSel1, ..., createString=True)
       Return an AtomSel whose indices() consists of the intersection of 
       the of the selection arguments. By default, the returned AtomSel can
       be reevaluated because a selection string is generated from the input
       AtomSels. The computational expense of this can be removed by specifying
       createString=False, but then the returned AtomSel cannot be
       reevaluated. 
 
   difference(AtomSel1, AtomSel2)
       Return an AtomSel with indices() of AtomSel1 that are not in AtomSel2.
 
   union(AtomSel1, ...)
       Return an AtomSel whose indices() consists of the union of 
       all the arguments, which should be AtomSel objects or strings. An
       arbitrary number of arguments can be specified. The returned AtomSel cannot be
       reevaluated. 
 
   notSelection(sel)
       Return an AtomSel whose indices() consists of all those argument sel's 
       Simulation but, not in its indices().
 
   AtomSel_fromPtr(string)
       Return an AtomSel object from a raw SWIG pointer string. This object
       is not managed by Python (i.e. its thisown==False).
 
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()
 
 
 
 
 
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

 
Classes
       
builtins.object
AtomSel

 
class AtomSel(builtins.object)
    AtomSel(*args, **kwargs)
 

 
  Methods defined here:
__eq__(self, other)
Return self==value.
__getitem__(self, *args) -> 'AtomSel'
__getslice__(self, *args, **kwargs) -> 'AtomSel'
__init__ = init(self, *args, **kwargs)
__len__(self, *args, **kwargs) -> 'int'
__repr__ = _swig_repr(self)
allValid(self, *args, **kwargs) -> 'bool'
apply(self, arg)
begin(self, *args, **kwargs) -> 'CDS::ConstIterator< AtomSel >'
containsAtom(self, *args, **kwargs) -> 'bool'
containsIndex(self, *args, **kwargs) -> 'bool'
deleteAtoms(self, *args, **kwargs) -> 'void'
end(self, *args, **kwargs) -> 'CDS::ConstIterator< AtomSel >'
endPos(self, *args, **kwargs) -> 'AtomSel::IndexType'
equals(self, *args, **kwargs) -> 'bool'
indices(self, *args, **kwargs) -> 'CDSList< int > const &'
next(self, *args, **kwargs) -> 'AtomSel::IndexType'
ok(self, *args, **kwargs) -> 'int'
ordered(self, *args, **kwargs) -> 'bool const'
origApply(self, *args, **kwargs) -> 'void'
prev(self, *args, **kwargs) -> 'AtomSel::IndexType'
pyXplorHelp(self, *args, **kwargs) -> 'String'
reevaluate(self, *args, **kwargs) -> 'void'
removeBySelIndex(self, *args, **kwargs) -> 'void'
setIndices(self, *args, **kwargs) -> 'void'
setOrdered(self, *args, **kwargs) -> 'void'
simulation(self, *args) -> 'Simulation *'
size(self, *args, **kwargs) -> 'int'
startPos(self, *args, **kwargs) -> 'AtomSel::IndexType'
string(self, *args, **kwargs) -> 'String'

Static methods defined here:
__swig_destroy__ = delete_AtomSel(...)

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)
thisown

 
The membership flag

Data and other attributes defined here:
__hash__ = None

 
Functions
       
AtomSel_fromIndices(*args, **kwargs)
AtomSel_fromPtr(*args, **kwargs) -> 'PyObject *'
asUnion(*args, **kwargs) -> 'AtomSel'
difference(*args, **kwargs) -> 'AtomSel'
init(self, *args, **kwargs)
intersect(*args, **kwargs) -> 'bool'
intersection(*args, **kwargs)
minResidDiff(*args, **kwargs) -> 'int'
monomericallyEqual(*args, **kwargs) -> 'bool'
notSelection(*args, **kwargs) -> 'AtomSel'
oldinit = __init__(self, *args, **kwargs)
pyXplorHelp(*args) -> 'String'
renamed_intersection = intersection(*args, **kwargs) -> 'AtomSel'
union(*args)