atomSelLang
index


Support for the Xplor-NIH atom selection language. This language
closely follows  
the XPLOR atom selection language, with the supported keywords listed
below. Added to the XPLOR atom selection language are the ``index''
and ``pseudo'' keywords. The ``index'' keyword which works as the
''id'' keyword, but on zero-offset indices instead of 1-offset atom
ids, and The PSEUdo keyword selects pseudo atoms.
 
Functions
 
  nameSelection(name,selection) - 
    Simple function to name an atom selection. The first argument is the
    name, while the second argument is an atomSel.AtomSel object.
      Example use:
 
    from atomSelLang import nameSelection
    nameSelection('preprolineC','name C and bondedTo (resname PRO)')
 
 
  setNamedSelection(simulation,name,atomIndices) -
     define or redefine the named atom selection. Example use is:
 
    sel=AtomSel("name C and bondedTo (resname PRO)")
    import atomSelLang
    atomSelLang.setNamedSelection(sel.simulation(),
                                  "preprolineC",sel.indices())
 
  addAbbreviation(name,abbreviation) -
    define an atom selection abbreviation to be substituted into the
    selection string whenever the literal ``[name]'' is encountered.
    Abbreviations can be nested. Abbreviations are global in the
    sense that they are defined for all simulation.Simulations.
 
  abbreviations() -
    return the currently defined abbreviations as a dictionary of
    name, selection items.
 
  addAttribute(sim,
               name,
               atomIndices) - add attribute with given name (a string) for
                              the specified simulation.Simulation. The
                              atomIndices is a sequence of floats, one for
                              every atom in the specified simulation.
                              Attribute-based selections are made using the
                              ATTRibute atom selection keyword, described
                              below.
  initAttribute(sim,name)   - initialize the named built-in attribute (listed
                              below). This action is performed automatically
                              when encountered in an atom selection string.
  getAttribute(sim,name)    - Return a vector of float describing the named
                              attribute for each atom of the Simulation.
 
  attributes(sim) - list the previously initialized or added attributes for
                    the specified simulation.Simulation.
                    
 
  select(simulation, string, ordered=False) -
     low-level routine which returns a list of atom indices given a
     simulation object and a selection string. If the optional ordered
     argument is specified as True, the returned indices will reflect 
     the order of the OR keywords. i.e. the selection "resid 1 or resid 2" 
     will have indices in reverse order of the selection "resid 2 or resid 1". 
     When combining subselections with overlapping atoms, lexical
     order is enforced. For instance, "resid 1 and (name C or name N)"
     will have PSF order, while "(name C or name N) and resid 1" will
     have order C, N. The form "name C N and resid 1" will be equivalent to
     the later case.
 
  setUseSegmentCase(val) - by default, comparisons to the segmentName are case
                           independent. If the segmentName should be taken as
                           case dependent call
                           setUsetSegmentCase(True).
 
  clearCache(sim) - Clear the cached values of resid, atom name and segment
                    name for the specified simulation.Simulation. This
                    function should not need be called in normal circumstances.
 
 
 
 
Two keyword statements can be combined with the words OR and AND to
specify selections which are the intersection and union, respectively,
of the two selections. Further, parentheses can be used to logically
group sub-selections.
 
Language Keywords (upper case):
 
    ALL
        selects all atoms. 
 
    factor AROUnd real
        selects all atoms that are within the specified real cutoff
        value around any selected atom in the factor.  
    ATOM
        *segment-name* *residue-number* *atom* selects all atoms that
        match the specified segment name, residue number, and atom
        name or wildcards of them.  
    ATTRibute property = | < | > | <= | >= | # real 
        selects all atoms that have (absolute) properties less than,
        equal to, not equal to, or greater than the specified real
        number.  
    BONDedto factor
        selects all atoms that share a bond with any atom in factor. 
    BYREs factor
        selects all atoms which have same segment name and residue number as
        any term in in factor.
    CHEMical *type* [*type* ...]
        selects all atoms that match the specified type(s) or a wildcard(s)
    HYDRogen
        selects all atoms with masses (atom property MASS)
        approximately less than 3.5 amu.  
    ID integer [integer ...]
        selects all atoms that match the specified internal atom
        number(s) (starting with 1). It should be used with caution. 
    INDEX integer [integer ...]
        selects all atoms that match the specified internal atom
        number(s) (starting with 0). It should be used with caution. 
    KNOWn
        selects all atoms with known coordinates. 
    NAME *atom* [*atom* ...]
        selects all atoms that match the specified atom name(s) or wildcard(s).
    NOT factor
        selects all atoms that have not been selected in the factor. 
    POINt 3d-vector CUT real
        selects all atoms that are within the specified real cutoff
        value around the specified 3d-vector.
    PSEUdo
        selects all atoms for which the value of PSEUDO is greater
        than 0. PSEUDO can be defined by the vector ID statement or
        the vector statement. It is internally reserved to flag pseudo
        atoms whose positions are used to represent non-coordinate
        parameters.   
    RECALL *named selection*
        recall the atoms selected by calling atomSelLang.setNamedSelection()
    RESIdue *residue-number* [*residue-number* ...]
        selects all atoms that match the specified residue number(s) or
        number range(s). A range is denoted using the colon character
        (:) separating two numbers with no intervening spaces and it
        will select all atoms that have residue numbers greater than
        or equal to the first residue number but less than or equal to
        the second residue number.   
    RESName *residue-name* [*residue-name* ...]
        selects all atoms that match the specified residue name(s)
        or wildcard(s).
    RESName residue-name:residue-name
        selects all atoms that have residue names greater than or
        equal to the first residue name but less than or equal to the
        second residue name.  
    SEGIdentifier *segment-name* [*segment-name* ...]
        selects all atoms that match the specified segment name(s) or
        wildcard(s).
    SEGIdentifier segment-name:segment-name 
        selects all atoms that have segment names greater than or
        equal to the first segment name but less than or equal to the
        second segment name.  
    TAG
        selects exactly one atom from each residue. These selected
        atoms may be used to ``tag" all residues without having to
        refer to residue numbers or identifiers. The sequence of
        selected atoms is determined by the order in which the
        residues have been created. 
    [abbreviation]
        selects atoms in the abbreviation defined by the addAbbreviation
        function. 
 
property:==
MASS, FRIC, X, Y, Z, VX, VY, VZ, charge. Other attributes may be added using 
the addAttribute function, described above.
 
wildcards:
    * - matches any string.
    % - matches a single character.
    # - matches any number.
    + - matches any digit.
 
 
 
# 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
AtomSelLang

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

 
  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_AtomSelLang(...)
abbreviations(*args, **kwargs) -> 'CDSMap< String,String >'
addAbbreviation(*args, **kwargs) -> 'void'
addAttribute(*args, **kwargs) -> 'void'
all(*args, **kwargs) -> 'AtomSelLang::Result *'
andArr(*args, **kwargs) -> 'AtomSelLang::Result *'
around(*args, **kwargs) -> 'AtomSelLang::Result *'
atom(*args, **kwargs) -> 'AtomSelLang::Result *'
attribute(*args, **kwargs) -> 'AtomSelLang::Result *'
attributes(*args, **kwargs) -> 'CDSList< String >'
bondedTo(*args, **kwargs) -> 'AtomSelLang::Result *'
byRes(*args, **kwargs) -> 'AtomSelLang::Result *'
clearCache(*args, **kwargs) -> 'void'
convertToFloat(*args, **kwargs) -> 'float_type'
getAttribute(*args, **kwargs) -> 'CDSVector< float_type >'
getNamedSelection(*args, **kwargs) -> 'AtomSelLang::Result *'
initAttribute(*args, **kwargs) -> 'void'
known(*args, **kwargs) -> 'AtomSelLang::Result *'
notArr(*args, **kwargs) -> 'AtomSelLang::Result *'
orArr(*args, **kwargs) -> 'AtomSelLang::Result *'
point(*args, **kwargs) -> 'AtomSelLang::Result *'
processOneProperty(*args, **kwargs) -> 'void'
prop(*args, **kwargs) -> 'AtomSelLang::Result *'
propList(*args, **kwargs) -> 'AtomSelLang::Result *'
pseudo(*args, **kwargs) -> 'AtomSelLang::Result *'
select(*args, **kwargs) -> 'CDSList< int >'
selectArray(*args, **kwargs) -> 'CDSVector< bool >'
setNamedSelection(*args, **kwargs) -> 'void'
setRecallSelection(*args, **kwargs) -> 'void'
setUseSegmentCase(*args, **kwargs) -> 'void'
tag(*args, **kwargs) -> 'AtomSelLang::Result *'

Data descriptors defined here:
__dict__

 
dictionary for instance variables (if defined)
__weakref__

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

 
cachedResidValues

 
cachedSegmentNameValues

 
result

 
resultType

 
thisown

 
The membership flag

Data and other attributes defined here:
BOOLVEC = 0
INTLIST = 1

 
Functions
       
AtomSelLang_abbreviations(*args) -> 'CDSMap< String,String >'
AtomSelLang_addAbbreviation(*args, **kwargs) -> 'void'
AtomSelLang_addAttribute(*args, **kwargs) -> 'void'
AtomSelLang_all(*args) -> 'AtomSelLang::Result *'
AtomSelLang_andArr(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_around(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_atom(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_attribute(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_attributes(*args, **kwargs) -> 'CDSList< String >'
AtomSelLang_bondedTo(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_byRes(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_clearCache(*args, **kwargs) -> 'void'
AtomSelLang_convertToFloat(*args, **kwargs) -> 'float_type'
AtomSelLang_getAttribute(*args, **kwargs) -> 'CDSVector< float_type >'
AtomSelLang_getNamedSelection(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_initAttribute(*args, **kwargs) -> 'void'
AtomSelLang_known(*args) -> 'AtomSelLang::Result *'
AtomSelLang_notArr(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_orArr(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_point(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_processOneProperty(*args, **kwargs) -> 'void'
AtomSelLang_prop(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_propList(*args, **kwargs) -> 'AtomSelLang::Result *'
AtomSelLang_pseudo(*args) -> 'AtomSelLang::Result *'
AtomSelLang_select(*args, **kwargs) -> 'CDSList< int >'
AtomSelLang_selectArray(*args, **kwargs) -> 'CDSVector< bool >'
AtomSelLang_setNamedSelection(*args, **kwargs) -> 'void'
AtomSelLang_setRecallSelection(*args, **kwargs) -> 'void'
AtomSelLang_setUseSegmentCase(*args, **kwargs) -> 'void'
AtomSelLang_tag(*args) -> 'AtomSelLang::Result *'
abbreviations = AtomSelLang_abbreviations(*args) -> 'CDSMap< String,String >'
addAbbreviation = AtomSelLang_addAbbreviation(*args, **kwargs) -> 'void'
addAttribute = AtomSelLang_addAttribute(*args, **kwargs) -> 'void'
atomSelLang_error(*args, **kwargs) -> 'int'
atomSelLang_lex(*args) -> 'int'
attributes = AtomSelLang_attributes(*args, **kwargs) -> 'CDSList< String >'
clearCache = AtomSelLang_clearCache(*args, **kwargs) -> 'void'
getAttribute = AtomSelLang_getAttribute(*args, **kwargs) -> 'CDSVector< float_type >'
initAttribute = AtomSelLang_initAttribute(*args, **kwargs) -> 'void'
nameSelection(name, sel)
Simpler function to name an atom selection. The first argument is the
 name, while the second argument is an atomSel.AtomSel object.
 Example use:
 
import atomSelLang
atomSelLang.nameSelection('preprolineC','name C and bondedTo (resname PRO)'
pyXplorHelp(*args) -> 'String'
setNamedSelection = AtomSelLang_setNamedSelection(*args, **kwargs) -> 'void'
setRecallSelection = AtomSelLang_setRecallSelection(*args, **kwargs) -> 'void'
setUseSegmentCase = AtomSelLang_setUseSegmentCase(*args, **kwargs) -> 'void'

 
Data
        cvar = <Swig global variables>