atomSelAction
index

modify or analyze an AtomSel
 
Member classes perform actions on atom objects associated with an
atomSel.AtomSel object. These are invoked using the apply() method 
of an AtomSel object. A user-defined AtomSelAction can be defined by
creating a class which derives from the PyAtomSelAction class.
 
Constituent classes:
 
SetProperty(name,value)
    set named property of all atom.Atoms in a selection
 
    The arguments are the name is a property of an Atom (e.g. pos) and 
    new value to use. The argument value can be a sequence of items of
    the appropriate type, such that different values can be assigned to
    each atom. In this case, the array must have length at least as large
    as the size of the AtomSel. Also note the order of atoms as documented
    in the atomSel.AtomSel documentation.
 
  Example:
 
    sel = AtomSel("name HN")
    sel.apply( SetProperty("atomName","H") )
    from vec3 import Vec3
    sel.apply( SetProperty("pos",Vec3(0,0,0)) )
 
 
GetProperty(name)
   get the named property of all atoms in a selection as a list-like object.
   The arguments is the name is a property of an Atom (e.g. pos). One must
   instantiate a GetProperty object, and then call the appropriate accessor
   from this list:
 
      stringVals() - for atomName, residueName, segmentName, chemType
      floatVals()  - for mass, charge
      intVals()    - for residueNum
      vec3Vals()   - for pos, vel
 
  *Or*
 
     simply use apply's returned value.
 
  Example:
 
    sel = AtomSel("name CA")
    getter = GetProperty("residueNum")
    sel.apply( getter )
    print( getter.intVals() )
 
  vs.
 
    print( AtomSel("name CA").apply( GetProperty("residueNum") ) )
 
 
SetVelAction(velVal)
 
  will set velocities of all atoms in the atom selection to the 
value velVal, of type vec3.Vec3.
 
Translate(transVal)
 
  will translate coordinates of all atoms in the selection to the 
value transVal, of type vec3.Vec3.
 
Rotate(rotMat,centerVec)
 
  will apply the rotation operation q = rotMat * (q-centerVec)
to the positions of all atoms in the selection, where q is the atom
position. If centerVec is omitted, it is taken to be the origin.
rotMat is of type mat3.Mat3, and centerVec is of type vec3.Vec3. 
 
Fit(fitTo,fitBy,altCoords)
 
  will perform an rmsd fitting to the list of atomic coordinates
specified in fitTo using the algorithm of Kabsch, Acta Cryst. A34, 827
(1978).  fitBy is an atomSel.AtomSel which specifies which
coordinates are used in the rmsd calculation (all known atoms by
default). If altCoords is specified, use these instead of those in the
selection to calculate the fit (but still perform the fit
transformation on the coordinates of the AtomSel). Once constructed a
Fit object contains the methods rotation() and translation() which
return R and T, the rotation matrix and translation vector which
transform the initial coordinates into the fit coordinates by the
expression:
  
   qFit = R q + T
 
The actual transformation is applied using an AtomSel's apply()
method. In this form, fitTo must have an entry for every atom in the 
simulation.Simulation. Alternately, fitTo can be an AtomSel (with
the same number of atoms as fitBy). Using an AtomSel allows one to fit
different coordinates within a Simulation, or within different
Simulations. An additional method, transDiff() returns the distance
between the centers of mass of the two selections.
 
 
RMSD(compare)
 
  compute the rmsd of the atoms of the AtomSel with the contents of
compare.  Compare can be a list of atomic coordinates (of length
sel.simulation().numAtoms()) or an atomSel.AtomSel with the correct
number of atoms.  Using an AtomSel allows one to compare different
coordinates within a Simulation, or within different Simulations.  No
property of the AtomSel is modified. Rather, after calling the
AtomSel's apply() method, one can access two methods of the RSMD
object:
    rmsd() 
      the overall rmsd. This is the value returned by the AtomSel's apply
      method.
    perResidue()
      returns a ordered list of (string,value) tuples which specify
      residue identity (via segmetName residueNum) and per-residue RMSD
      value.
    byResidue()
      returns a dictionary, which contains per-residue RMSD values
      indexed by residue number.
 
 
examples:
 
#translate all atoms 3 angstroms in the x direction
#
from atomSelAction import Translate
AtomSel("all").apply( Translate(Vec3(3,0,0)) )
 
#move all atoms in residues 1-30 such that the CA atoms of those
#residues best-fit the corresponding CA atoms in residues 61-90.
#
AtomSel("resid 1:30").apply( Fit("name CA and resid 61:90",
                                 "name CA and resid  1:30") )
 
#compute the backbone rmsd with the coordinates stored in otherCoords
#the 
#
comparer=RMSD(otherCoords)
rmsd = AtomSel("name C or name CA or name N").apply(comparer)
for resid,val in comparer.perResidue():
        print resid, val
 
standalone function: 
  minDistance(sel1,sel2) - computes the minimum distance between atoms
                           in the two given atomSel.AtomSels.
 
 
 
# 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
Base
Fit
GetProperty
PyAtomSelAction
RMSD
Rotate
SetProperty
SetVelAction
Translate
CDSList_String
String

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

 
  Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'
run(self, *args, **kwargs) -> 'void'

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

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

 
class CDSList_String(builtins.object)
    CDSList_String(*args)
 

 
  Methods defined here:
__delitem__(self, *args, **kwargs) -> 'void'
__getitem__(self, *args) -> 'CDSList< String >'
__getslice__(self, *args, **kwargs) -> 'CDSList< String >'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__len__(self, *args, **kwargs) -> 'int'
__repr__ = _swig_repr(self)
__setitem__(self, *args, **kwargs) -> 'void'
append(self, *args, **kwargs) -> 'void'
help(self, *args, **kwargs) -> 'String'
remove(self, *args, **kwargs) -> 'void'
removeAll(self, *args, **kwargs) -> 'void'

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

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

 
class Fit(Base)
    Fit(*args)
 

 
 
Method resolution order:
Fit
Base
builtins.object

Methods defined here:
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
init_unused(self, *args, **kwargs) -> 'void'
rotation(self, *args, **kwargs) -> 'Mat3'
run(self, *args, **kwargs) -> 'void'
transDiff(self, *args, **kwargs) -> 'Vec3'
translation(self, *args, **kwargs) -> 'Vec3'

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

Data descriptors defined here:
fitToSel

 
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class GetProperty(Base)
    GetProperty(*args, **kwargs)
 

 
 
Method resolution order:
GetProperty
Base
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
floatVals(self, *args, **kwargs) -> 'CDSVector< float_type >'
init_unused(self, *args, **kwargs) -> 'void'
intVals(self, *args, **kwargs) -> 'CDSVector< int >'
run(self, *args, **kwargs) -> 'void'
stringVals(self, *args, **kwargs) -> 'CDSList< String >'
vec3Vals(self, *args, **kwargs) -> 'CDSVector< Vec3 >'

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

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class PyAtomSelAction(Base)
    PyAtomSelAction(*args, **kwargs)
 

 
 
Method resolution order:
PyAtomSelAction
Base
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
pyXplorHelp(self, *args, **kwargs) -> 'String'

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

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'
run(self, *args, **kwargs) -> 'void'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class RMSD(Base)
    RMSD(arg)
 

 
 
Method resolution order:
RMSD
Base
builtins.object

Methods defined here:
__init__ = RMSD__init__(s, arg)
__repr__ = _swig_repr(self)
byResidue(s)
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
perResidue(self, *args, **kwargs) -> 'CDSList< Pair< String,float_type > >'
rmsd(self, *args, **kwargs) -> 'float_type'
run(self, *args, **kwargs) -> 'void'

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

Data descriptors defined here:
compareSel

 
thisown

 
The membership flag

Methods inherited from Base:
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class Rotate(Base)
    Rotate(*args, **kwargs)
 

 
 
Method resolution order:
Rotate
Base
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
run(self, *args, **kwargs) -> 'void'

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

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class SetProperty(Base)
    SetProperty(name, val)
 

 
 
Method resolution order:
SetProperty
Base
builtins.object

Methods defined here:
__init__ = SetProperty__init__(s, name, val)
__repr__ = _swig_repr(self)
run(self, *args, **kwargs) -> 'void'

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

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class SetVelAction(Base)
    SetVelAction(*args, **kwargs)
 

 
 
Method resolution order:
SetVelAction
Base
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
run(self, *args, **kwargs) -> 'void'

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

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
class String(builtins.object)
    String(*args)
 

 
  Methods defined here:
__iadd__(self, *args) -> 'CDSString< char > &'
__init__(self, *args)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
blockSize(self, *args) -> 'int'
charPtr(self, *args, **kwargs) -> 'char *'
contains(self, *args) -> 'bool'
copy(self, *args, **kwargs) -> 'CDSString< char >'
count(self, *args, **kwargs) -> 'int'
downcase(self, *args, **kwargs) -> 'void'
find(self, *args) -> 'int'
glob(self, *args, **kwargs) -> 'bool'
gsub(self, *args, **kwargs) -> 'int'
length(self, *args, **kwargs) -> 'unsigned int'
matches(self, *args) -> 'bool'
replace(self, *args, **kwargs) -> 'int'
resize(self, *args, **kwargs) -> 'void'
split(self, *args, **kwargs) -> 'CDSList< CDSString< char > >'
startswith(self, *args, **kwargs) -> 'bool'
strip(self, *args, **kwargs) -> 'CDSString< char >'
upcase(self, *args, **kwargs) -> 'void'

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

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

 
class Translate(Base)
    Translate(*args, **kwargs)
 

 
 
Method resolution order:
Translate
Base
builtins.object

Methods defined here:
__init__(self, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__repr__ = _swig_repr(self)
run(self, *args, **kwargs) -> 'void'

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

Data descriptors defined here:
thisown

 
The membership flag

Methods inherited from Base:
finish_unused(self, *args, **kwargs) -> 'void'
init_unused(self, *args, **kwargs) -> 'void'
returnMethodName(self, *args, **kwargs) -> 'String'

Data descriptors inherited from Base:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

 
list of weak references to the object (if defined)

 
Functions
       
RMSD__init__(s, arg)
SetProperty__init__(s, name, val)
minDistance(*args) -> 'float_type'
pyXplorHelp(*args) -> 'String'

 
Data
        __CDSVector_hh__ = 1
atomName = 2
atomNameVec = 12
charge = 9
chargeVec = 19
chemType = 3
chemTypeVec = 13
fric = 8
fricVec = 18
mass = 7
massVec = 17
pos = 5
posVec = 15
residueName = 1
residueNameVec = 11
residueNum = 4
residueNumVec = 14
segmentName = 0
segmentNameVec = 10
vel = 6
velVec = 16