This module defines classes for handling atomic data. Read this page using
ProDy stores atomic data in instances of
AtomGroup class, which
supports multiple coordinate sets, e.g. models from an NMR structure or
snapshots from a molecular dynamics trajectory.
Instances of the class can be obtained by parsing a PDB file as follows:
In : from prody import * In : ag = parsePDB('1aar') In : ag Out: <AtomGroup: 1aar (1218 atoms)>
In addition to
AtomGroup class, following classes that act as
pointers provide convenient access subset of data:
Selection- Points to an arbitrary subset of atoms. See Atom Selections and Operations on Selections for usage examples.
Segment- Points to atoms that have the same segment name.
Chain- Points to atoms in a segment that have the same chain identifier.
Residue- Points to atoms in a chain that have the same residue number and insertion code.
AtomMap- Points to arbitrary subsets of atoms while allowing for duplicates and missing atoms. Indices of atoms are stored in the order provided by the user.
Atom- Points to a single atom
Bond- Points to two connected atoms
Atom data fields¶
Atom Data Fields defines an interface for handling data parsed from molecular
data files, in particular PDB files. Aforementioned classes offer
set functions for manipulating this data. For example, the following
prints residue names:
In : ag.getResnames() Out: array(['MET', 'MET', 'MET', ..., 'HOH', 'HOH', 'HOH'], dtype='|S6')
Atom Flags module defines a way to mark atoms with certain properties, such as atoms that are part of a protein. Following example checks whether all atoms of ag are protein atoms:
In : ag.isprotein Out: False
This indicates that there are some non-protein atoms, probably water atoms. We can easily make a count as follows:
In : ag.numAtoms('protein') Out: 1203 In : ag.numAtoms('hetero') Out: 15 In : ag.numAtoms('water') Out: 15
Atom Selections offer a flexible and powerful way to access subsets of
selections and is one of the most important features of ProDy. The details
of the selection grammar is described in Atom Selections. Following examples
show how to make quick selections using the overloaded
In : ag.chain_A # selects chain A Out: <Selection: 'chain A' from 1aar (608 atoms)> In : ag.calpha # selects alpha carbons Out: <Selection: 'calpha' from 1aar (152 atoms)> In : ag.resname_ALA # selects alanine residues Out: <Selection: 'resname ALA' from 1aar (20 atoms)>
It is also possible to combine selections with
In : ag.chain_A_and_backbone Out: <Selection: 'chain A and backbone' from 1aar (304 atoms)> In : ag.acidic_or_basic Out: <Selection: 'acidic or basic' from 1aar (422 atoms)>
Using dot operator will behave like the logical
In : ag.chain_A.backbone Out: <Selection: '(backbone) and (chain A)' from 1aar (304 atoms)>
For this to work, the first word following the dot operator must be a flag
label or a field name, e.g.
etc. Underscores will be interpreted as white space, as obvious from the
previous examples. The limitation of this is that parentheses, special
characters cannot be used.
Following functions can be used for permanent data storage:
Following function can be used to get an
AtomMap that sorts atoms
based on a given property:
Following function can be used check whether a word is reserved because
it is used internally by