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 | ||||||||||
|
Functions | ||
|
Data | ||
cvar = <Swig global variables> |