This module defines atom flags that are used in Atom Selections. You can read this page in interactive sessions using help(flags).
Flag labels can be used in atom selections:
In [1]: from prody import *
In [2]: p = parsePDB('1ubi')
In [3]: p.select('protein')
Out[3]: <Selection: 'protein' from 1ubi (602 atoms)>
Flag labels can be combined with dot operator as follows to make selections:
In [4]: p.protein
Out[4]: <Selection: 'protein' from 1ubi (602 atoms)>
In [5]: p.protein.acidic # selects acidic residues
Out[5]: <Selection: '(acidic) and (protein)' from 1ubi (94 atoms)>
Flag labels can be prefixed with 'is' to check whether all atoms in an Atomic instance are flagged the same way:
In [6]: p.protein.ishetero
Out[6]: False
In [7]: p.water.ishetero
Out[7]: True
Flag labels can also be used to make quick atom counts:
In [8]: p.numAtoms()
Out[8]: 683
In [9]: p.numAtoms('protein')
Out[9]: 602
In [10]: p.numAtoms('water')
Out[10]: 81
indicates one of the following residues:
ASX (B) | asparagine or aspartic acid |
GLX (Z) | glutamine or glutamic acid |
CSO (C) | S-hydroxycysteine |
HIP (H) | ND1-phosphohistidine |
HSD (H) | prototropic tautomer of histidine, H on ND1 (CHARMM) |
HSE (H) | prototropic tautomer of histidine, H on NE2 (CHARMM) |
HSP (H) | protonated histidine |
MSE | selenomethionine |
SEC (U) | selenocysteine |
SEP (S) | phosphoserine |
TPO (T) | phosphothreonine |
PTR (Y) | O-phosphotyrosine |
XLE (J) | leucine or isoleucine |
XAA (X) | unspecified or unknown |
You can modify the list of non-standard amino acids using addNonstdAminoacid(), delNonstdAminoacid(), and listNonstdAAProps().
indicates residues with the following names:
DA | 2’-deoxyadenosine-5’-monophosphate |
DC | 2’-deoxycytidine-5’-monophosphate |
DG | 2’-deoxyguanosine-5’-monophosphate |
DT | 2’-deoxythymidine-5’-monophosphate |
DU | 2’-deoxyuridine-5’-monophosphate |
A | adenosine-5’-monophosphate |
C | cytidine-5’-monophosphate |
G | guanosine-5’-monophosphate |
T | 2’-deoxythymidine-5’-monophosphate |
U | uridine-5’-monophosphate |
indicates following nucleoside derivatives that are recognized by PDB:
AMP | adenosine monophosphate |
ADP | adenosine-5’-diphosphate |
ATP | adenosine-5’-triphosphate |
CDP | cytidine-5’-diphosphate |
CTP | cytidine-5’-triphosphate |
GMP | guanosine |
GDP | guanosine-5’-diphosphate |
GTP | guanosine-5’-triphosphate |
TMP | thymidine-5’-phosphate |
TTP | thymidine-5’-triphosphate |
UMP | 2’-deoxyuridine 5’-monophosphate |
UDP | uridine 5’-diphosphate |
UTP | uridine 5’-triphosphate |
indices HOH and DOD recognized by PDB and also WAT, TIP3, H2O, OH2, TIP, TIP2, and TIP4 recognized by molecular dynamics (MD) force fields.
Previously used water types HH0, OHH, and SOL conflict with other compounds in the PDB, so are removed from the definition of this flag.
indicates the following ions most of which are recognized by the PDB and others by MD force fields.
PDB | Source | Conflict | ||
AL | aluminum | Yes | ||
BA | barium | Yes | ||
CA | calcium | Yes | ||
CD | cadmium | Yes | ||
CL | chloride | Yes | ||
CO | cobalt (ii) | Yes | ||
CS | cesium | Yes | ||
CU | copper (ii) | Yes | ||
CU1 | copper (i) | Yes | ||
CUA | dinuclear copper | Yes | ||
HG | mercury (ii) | Yes | ||
IN | indium (iii) | Yes | ||
IOD | iodide | Yes | ||
K | potassium | Yes | ||
MG | magnesium | Yes | ||
MN3 | manganese (iii) | Yes | ||
NA | sodium | Yes | ||
PB | lead (ii) | Yes | ||
PT | platinum (ii) | Yes | ||
RB | rubidium | Yes | ||
TB | terbium (iii) | Yes | ||
TL | thallium (i) | Yes | ||
WO4 | thungstate (vi) | Yes | ||
YB | ytterbium (iii) | Yes | ||
ZN | zinc | Yes | ||
CAL | calcium | No | CHARMM | Yes |
CES | cesium | No | CHARMM | Yes |
CLA | chloride | No | CHARMM | Yes |
POT | potassium | No | CHARMM | Yes |
SOD | sodium | No | CHARMM | Yes |
ZN2 | zinc | No | CHARMM | No |
Ion identifiers that are obsoleted by PDB (MO3, MO4, MO5, MO6, NAW, OC7, and ZN1) are removed from this definition.
Following elements found in proteins are recognized by applying regular expressions to atom names:
'not ion' is appended to above definitions to avoid conflicts with ion atoms.
Following secondary structure flags are defined but before they can be used, secondary structure assignments must be made.
Following functions can be used to customize flag definitions:
Learn, change, or reset Atom Flags definitions.
Learn a definition
Calling this function with no arguments will return list of flag names whose definitions you can learn:
In [1]: flagDefinition()
Out[1]:
['acidic',
'acyclic',
'aliphatic',
'aminoacid',
'aromatic',
'at',
'backbone',
'backbonefull',
'basic',
'bb',
'bbfull',
'buried',
'carbon',
'cg',
'charged',
'cyclic',
'heme',
'hydrogen',
'hydrophobic',
'ion',
'large',
'lipid',
'medium',
'neutral',
'nitrogen',
'nonstdaa',
'nucleic',
'nucleobase',
'nucleoside',
'nucleotide',
'oxygen',
'polar',
'protein',
'purine',
'pyrimidine',
'small',
'stdaa',
'sugar',
'sulfur',
'surface',
'water']
Passing a flag name will return its definition:
In [2]: flagDefinition('backbone')
Out[2]: ['C', 'CA', 'N', 'O']
In [3]: flagDefinition('hydrogen')
Out[3]: '[0-9]?H.*'
Change a definition
Calling the function with editable=True argument will return flag names those definitions that can be edited:
In [4]: flagDefinition(editable=True)
Out[4]:
['at',
'backbone',
'backbonefull',
'bb',
'bbfull',
'carbon',
'cg',
'heme',
'hydrogen',
'ion',
'lipid',
'nitrogen',
'nucleobase',
'nucleoside',
'nucleotide',
'oxygen',
'purine',
'pyrimidine',
'sugar',
'sulfur',
'water']
Pass an editable flag name with its new definition:
In [5]: flagDefinition(nitrogen='N.*')
In [6]: flagDefinition(backbone=['CA', 'C', 'O', 'N'])
In [7]: flagDefinition(nucleobase=['ADE', 'CYT', 'GUN', 'THY', 'URA'])
Note that the type of the new definition must be the same as the type of the old definition. Flags with editable definitions are: at, backbone, backbonefull, bb, bbfull, carbon, cg, heme, hydrogen, ion, lipid, nitrogen, nucleobase, nucleoside, nucleotide, oxygen, purine, pyrimidine, sugar, sulfur, and water
Reset definitions
Pass reset keyword as follows to restore all default definitions of editable flags and also non-standard amino acids.
In [8]: flagDefinition(reset='all')
Or, pass a specific editable flag label to restore its definition:
In [9]: flagDefinition(reset='nitrogen')
Return properties of non-standard amino acid resname.
In [1]: listNonstdAAProps('PTR')
Out[1]: ['acidic', 'aromatic', 'cyclic', 'large', 'polar', 'surface']
Deprecated for removal in v1.4, use listNonstdAAProps() instead.
Add non-standard amino acid resname with properties selected from:
In [1]: addNonstdAminoacid('PTR', 'acidic', 'aromatic', 'cyclic', 'large',
...: 'polar', 'surface')
...:
Default set of non-standard amino acids can be restored as follows:
In [2]: flagDefinition(reset='nonstdaa')
Delete non-standard amino acid resname.
In [1]: delNonstdAminoacid('PTR')
In [2]: flagDefinition('nonstdaa')
Out[2]:
['ASX',
'CSO',
'GLX',
'HIP',
'HSD',
'HSE',
'HSP',
'MSE',
'SEC',
'SEP',
'TPO',
'XAA',
'XLE']
Default set of non-standard amino acids can be restored as follows:
In [3]: flagDefinition(reset='nonstdaa')