selectTools
index


 
tools for manipulating atom selections

 
Functions
       
IVM_breakDisulfides(ivm, sel=0)
for the ivm.IVM object, break disulfide bonds in given
selection (default: all disulfides)
IVM_breakIsopeptides(ivm, sel=0)
for the ivm.IVM object, break isopeptide bonds in given
selection (default: all isopeptides)
IVM_breakProlines(ivm, sel=0, breakSelStr='name CD or name CG')
In an ivm.IVM object, break proline rings at a specified position.
 
The position of the break is specified by the argument breakSelStr, a string
with an XPLOR-style selection of two covalently bonded ring atoms.
IVM_breakRiboses(ivm, sel='tag', breakSelStr="name C4' or name O4'")
In an ivm.IVM object, break ribose rings at a specified position.
 
The position of the break is specified by the argument breakSelStr, a string
with an XPLOR-style selection of two covalently bonded ring atoms.
IVM_flexibilizeRiboses(ivm, sel='all')
Specify the active degrees of freedom in ribose rings to include both
torsion and bond angles, by setting the corresponding ivm.IVM hinge
types to be "bendtorsion".
 
A subset of rings can be specified using the selection string in the sel
argument.
IVM_groupRigidBackbone(ivm, sel='name CA')
For the ivm.IVM object, group omega angles in selection sel. Due
to implementation details, the dihedral angle which is constrained is
currently actually the HN-N-C-O angle, so that the bond angle term is
essential to maintain peptide bond planarity.
IVM_groupRigidSidechain(ivm, sel='all')
Group rigid sidechain regions in selection sel for the ivm.IVM object
 
Default protein and nucleic acid rigid regions are grouped, as specified in
rigidProteinSelections and rigidNucleicSelections.
breakAtomSelString(selString, lineLen=80, spacer='', initialShift=0)
Break the line obtained from makeAtomSelStringFromResidList into
   several lines.
convertToAtom(arg, sim=0)
given an atomSel.AtomSel or a string convert to atom selection
and check that just a single atom.Atom is selected. Return that Atom.
If the argument is an Atom, just return it, if its simulation matches the
sim argument, otherwise, try to find an atom with the same segid, resid,
and name in simulation sim (or currentSimulation if sim is not specified).
convertToAtomSel(arg, sim=None, ordered=None)
convert arg to an atomSel.AtomSel, if it is not already one. The
argument can be an AtomSel, a selection string, a sequence of atoms, a
sequence of atom indices, or a raw SWIG pointer string.
 
If sim is specified it is used instead of simulation.currentSimulation.
If sim is specified, arg is an AtomSel, and the simulations don't match,
a new AtomSel is created using the string from arg and the sim argument.
 
If specified, the ordered argument will specify the value of ordered()
for the returned AtomSel.
convertToSelectionIndices(sel, sim=0)
allowed input: string, atom.Atom, atomSel.AtomSel, single index,
    or list of indices
output: list of indices
correctSymmetricSidechains(sel=None, sim=0)
Correct PHE, TYR, ASP, ARG, and GLU sidechains if outside angle range.
 
Step through a selection (specified via the sel argument, a selection
string), looking for PHE, TYR, ASP, ARG, and GLU residues.  Make sure that
each of those sidechains has its chi2 (chi3 for GLU and chi5 for ARG) angle
in a specific range.  If not, exchange the positions of the atoms in
symmetric locations to force that angle to be in the correct range.  For
ARG, ASP and GLU, the angle range is taken from IUPAC rules [Biochemistry
9:3471-3479 (1970), section 2.3.2.].  For PHE and TYR, the rules makes no
sense as the most populated rotamer is right at the edge of the range, so
the range 0..180 degrees is used instead.
 
After the correction is made a group may still be outside the range if it's
not completely planar.  In such case, the orientation that minimizes the
difference between the angle and the closest range bound is kept.
 
Note that protein topology/parameter sets before 2.0 have the wrong 
definition for ARG, such that it is treated as a special case.
fixMethylImpropers(sel='all', verbose=False)
Swap proton positions on methyls such that improper energies are lowered.
 
Swapped coordinates include any C, N or S bound to three protons.
fixProtonImpropers(sel='all', verbose=False)
Swap proton positions on methyls or methylenes such that improper
energies are lowered. 
 
Swapped coordinates include any C, N or S bound to two or three protons.
genPlanarityRestraints(basePairs, xSim)
Given a sequence of base pairs, and an
xplorSimulation.XplorSimulation, generate planarity restraints for
nucleic acid base pairs. Each base pair can be represented as a pair of
residue numbers, or as a pair of tuples specifying (segid,resid).
 
The restraints are returned as a string.
getResids(sel=0)
return a list of unique residue ids. If an atom selection sel is
specified, return the unique residue ids in the selection.
getSegids(sel='tag')
return a list of unique segment ids. If an atom selection sel is
specified, return the unique segment ids in the selection.
getSegsResidues(sel='tag', sim=0)
given an atom selection return a dictionary whose keys are segment
names. The value of each dictionary entry is a list of named tuples of
(resid, resname) for each residue contained therein.
groupRigidNucleicAcid(sel='not PSEUDO', sim=None)
return a list of groups atoms which are members of fixed
regions of nucleic acid bases.
The second argument is a selection in sim in which the groupings are
to be made.
groupRigidProtein(sel='not PSEUDO', sim=None)
return a list of groups atoms which are members of fixed
regions of protein backbone and sidechains.
The second argument is a selection in sim in which the groupings are
to be made.
groupRigidSel(rigidSelList, sel='not PSEUDO', sim=None)
Return a list of groups atoms. The groups are formed by iterating
through all residues in the selection, and making groups from each
group selection string.
The last argument is a selection in sim in which the groupings are
to be made.
groupRigidSideChains(sel='all', sim=None)
return a list of groups atoms which are members of fixed
regions of protein sidechains.
The second argument is a selection in sim in which the groupings are
to be made.
isCisPeptide(resid, segid='')
Probe the value of the omega angle between the residue described by resid 
and segid and the subsequent residue. If the angle is 0 to within 
+/-cisTol, then the function returns True. For any other condition (angle
more than cisTol away from 0, or an error condition), False
is returned.
makeAtomSelString(sel)
Given a sequence of atoms, generate an atom selection string.
This can be used to generate a selection string for an atomSel.AtomSel generated using a different iupacNaming
naming scheme.
makeAtomSelStringFromResidList(resList)
Make an Xplor atom selection string from a list of residue numbers.
maxResid(sel=0, sim=0)
return the largest residue id
minResid(sel=0, sim=0)
return the smallest residue id
numElectrons(atom)
Given an atom.Atom object, return the number of electrons.
numResidues(sel='not PSEUDO')
return the number of residues in the specified atomSel.AtomSel
oneToThree(name)
Convert a one character residue name to the corresponding three
character version.
renameResidues(seq, type='protein')
Convert single letter to three letter residue names. The type
argument may be 'protein' (default) or 'nucleic'.
threeToOne(name)
Convert a three character residue name to the corresponding one
character version. This will handle standard protein and nucleic 
3-character residue names.
toAtomSelString(atom)
Given an atom, return a selection string.

 
Data
        chiRange = (-1.5707963267948966, 1.5707963267948966)
chiSels = ('cb', 'cg', 'cd', 'oe1')
cisTol = 7
pi = 3.141592653589793
planarityDefs = {'ADE': {1: 'name N1', 3: 'name N1 or name C6 or name C2'}, 'CYT': {1: 'name N3', 3: 'name N3 or name C2 or name C4'}, 'GUA': {1: 'name N1', 3: 'name N1 or name C6 or name C2'}, 'PRF': {1: 'name N1', 3: 'name N1 or name C6 or name C2'}, 'URI': {1: 'name N3', 3: 'name N3 or name C2 or name C4'}}
planarityRestraint = '\ngroup\n select = ((resid %i and (%s)) or\n (resid %i and (%s)))\n weight = %s\nend\n\n'
res = 'GLU'
residueMapProtein = {'#': 'HIH', 'A': 'ALA', 'C': 'CYS', 'D': 'ASP', 'E': 'GLU', 'F': 'PHE', 'G': 'GLY', 'H': 'HIS', 'I': 'ILE', 'K': 'LYS', ...}
rigidNucleicSelections = {'ADE': 'name N9 or name C4 or name N3 or name C2 or name... name N6\n or name H2 or name H8 or name H6#', 'AP7': 'name N9 or name C4 or name N3 or name C2 or name... or name H2 or name H8 or name H1 or name H6#', 'CYT': 'name N1 or name C6 or name C5 or name C4 or name...e N4 or name H5 or name H6 or name O2 or name H4#', 'GUA': 'name N9 or name C4 or name N3 or name C2 or name... name O6\n or name H1 or name H8 or name H2#', 'TED': 'name N1 or name C6 or name C5 or name C4 or name...me H6 or name C7 or name O4 or name H3 or name O2', 'THY': 'name N1 or name C6 or name C5 or name C4 or name...me C2 or name O4 or name O2 or name H3 or name H6', 'URI': 'name N1 or name C6 or name C5 or name C4 \n ...r name O2 or name H3 or name H5\n or name H6'}
rigidProteinSelections = {'ARG': 'name NE or name CZ or name NH*', 'ASN': 'name CG or name OD1 or name ND2', 'ASP': 'name CG or name OD*', 'CED': 'name MN or name OY* or name CY* or name NY*', 'CYSP': 'name CS6 or name CS7 or name CS5 or name NS1 or ...2 or name CS3 or name CS4 or name CS8 or name CS9', 'GLN': 'name CD or name OE1 or name NE2', 'GLU': 'name CD or name OE*', 'HIS': 'name CG or name ND1 or name CD2 or name CE1 or name NE2', 'PHE': 'name CG or name CD1 or name CD2 or name CE1 or name CE2 or name CZ', 'TRP': 'name CG or name CD1 or name CD2 or name NE1 or n... name CE3 or name CZ2 or name CZ3 or name CH2', ...}
sel = 'name N1 or name C6 or name C5 or name C4 \n ...r name O2 or name H3 or name H5\n or name H6'
symPairs = (('oe1', 'oe2'),)
symmetricSidechains = {'ARG': ((-1.5707963267948966, 1.5707963267948966), ('cd', 'ne', 'cz', 'nh1'), (('nh1', 'nh2'), ('hh11', 'hh21'), ('hh12', 'hh22'))), 'ASP': ((-1.5707963267948966, 1.5707963267948966), ('ca', 'cb', 'cg', 'od1'), (('od1', 'od2'),)), 'GLU': ((-1.5707963267948966, 1.5707963267948966), ('cb', 'cg', 'cd', 'oe1'), (('oe1', 'oe2'),)), 'PHE': ((0, 3.141592653589793), ('ca', 'cb', 'cg', 'cd1'), (('cd1', 'cd2'), ('ce1', 'ce2'), ('hd1', 'hd2'), ('he1', 'he2'))), 'TYR': ((0, 3.141592653589793), ('ca', 'cb', 'cg', 'cd1'), (('cd1', 'cd2'), ('ce1', 'ce2'), ('hd1', 'hd2'), ('he1', 'he2')))}