### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 7. Core modules »

# 7.3. Atom selection Hierarchy — `MDAnalysis.core.Selection`

These objects are constructed and applied to the group

Currently all atom arrays are handled internally as sets, but returned as AtomGroups

class `MDAnalysis.core.Selection.``BackboneSelection`

  A BackboneSelection contains all atoms with name ‘N’, ‘CA’, ‘C’, ‘O’.

  This excludes OT* on C-termini (which are included by, eg VMD’s backbone selection).

class `MDAnalysis.core.Selection.``BaseSelection`

  Selection of atoms in nucleobases.

  Recognized atom names (from CHARMM):

  > ‘N9’, ‘N7’, ‘C8’, ‘C5’, ‘C4’, ‘N3’, ‘C2’, ‘N1’, ‘C6’, ‘O6’,’N2’,’N6’, ‘O2’,’N4’,’O4’,’C5M’

class `MDAnalysis.core.Selection.``CASelection`

  Select atoms named CA in protein residues (supposed to be the C-alphas)

class `MDAnalysis.core.Selection.``NucleicBackboneSelection`

  A NucleicBackboneSelection contains all atoms with name “P”, “C5’”, C3’”, “O3’”, “O5’”.

class `MDAnalysis.core.Selection.``NucleicSelection`

  A nucleic selection consists of all atoms in nucleic acid residues with recognized residue names.

  Recognized residue names:

  - from the Charmm force field ::

      awk ‘/RESI/ {printf “’”’”%s”’”’,”,$2 }’ top_all27_prot_na.rtf

  - recognized: ‘ADE’, ‘URA’, ‘CYT’, ‘GUA’, ‘THY’

class `MDAnalysis.core.Selection.``NucleicSugarSelection`

  A NucleicSugarSelection contains all atoms with name ‘C1’‘, ‘C2’‘,’C3’‘, ‘C4’‘, ‘O2’‘,’O4’‘,’O3’‘.

class `MDAnalysis.core.Selection.``NucleicXstalSelection`

  A nucleic selection consists of all atoms in nucleic acid residues with PDB-like resnames.

  Recognized residue names:

  - from the Charmm force field::

      awk ‘/RESI/ {printf “’”’”%s”’”’,”,$2 }’ top_all27_prot_na.rtf

  - recognized: ‘A’, ‘U’, ‘C’, ‘G’, ‘DT’,’DA’,’DC’,’DG’

class `MDAnalysis.core.Selection.``PropertySelection`(prop, operator, value, abs=False)

  Some of the possible properties: x, y, z, radius, mass,

class `MDAnalysis.core.Selection.``ProteinSelection`

  A protein selection consists of all residues with recognized residue names.

  Recognized residue names in `ProteinSelection.prot_res`.

  > - from the CHARMM force field::

  >     awk ‘/RESI/ {printf “’”’”%s”’”’,”,$2 }’ top_all27_prot_lipid.rtf

  > - manually added special CHARMM, OPLS/AA and Amber residue names.

  > - still missing: Amber N- and C-terminal residue names

  `prot_res` = {'GLH': None, 'ILE': None, 'ALAD': None, 'GLUH': None, 'GLN': None, 'HISH': None, 'ASN1': None, 'HYP': None, 'GLY': None, 'HIP': None, 'ARGN': None, 'MSE': None, 'CYS1': None, 'GLU': None, 'CYS2': None, 'CYS': None, 'HISE': None, 'ASP': None, 'SER': None, 'HSD': None, 'HSE': None, 'PRO': None, 'CYX': None, 'ASPH': None, 'ORN': None, 'HSP': None, 'HID': None, 'HIE': None, 'LYN': None, 'DAB': None, 'ASN': None, 'CYM': None, 'HISD': None, 'VAL': None, 'THR': None, 'HISB': None, 'HIS': None, 'HIS1': None, 'HIS2': None, 'TRP': None, 'HISA': None, 'ACE': None, 'ASH': None, 'CYSH': None, 'PGLU': None, 'LYS': None, 'PHE': None, 'ALA': None, 'QLN': None, 'MET': None, 'LYSH': None, 'NME': None, 'LEU': None, 'ARG': None, 'TYR': None}

    Dictionary of recognized residue names (3- or 4-letter).

class `MDAnalysis.core.Selection.``SelectionParser`

  A small parser for selection expressions. Demonstration of recursive descent parsing using Precedence climbing (see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm). Transforms expressions into nested Selection tree.

  For reference, the grammar that we parse is

      E(xpression)--> Exp(0)
      Exp(p) -->      P {B Exp(q)}
      P -->           U Exp(q) | "(" E ")" | v
      B(inary) -->    "and" | "or"
      U(nary) -->     "not"
      T(erms) -->     segid [value]
                      | resname [value]
                      | resid [value]
                      | name [value]
                      | type [value]

### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 7. Core modules »