ProDy
Protein Dynamics and Sequence
Analysis in Python
Introduction
ProDy to interfejs programu aplikacyjnego (API) przeznaczony do analizy dynamiki
struktury białek, a w szczególności do wnioskowania o dynamice białek na podstawie
dużych heterogenicznych zespołów strukturalnych. Zawiera kilka aplikacji wiersza poleceń
(Aplikacje ProDy) i graficzny interfejs użytkownika do wizualizacji.
ProDy is an application programming interface (API) designed for structure-based analysis of
protein dynamics, in particular for inferring protein dynamics from large heterogeneous
structural ensembles. It comes with several command line applications (ProDy Applications)
and graphical user interface for visualization.
Installation
1a. Method 1:
pip install prody
1b. Method 2:
conda install prody
2. from prody import *
from pylab import *
File Parsers
To load a molecule, there exist some parser functions, prefixed with parse. When
using parsePDB(), usually an identifier will be sufficient, If corresponding file is found in the
current working directory, it will be used, otherwise it will be downloaded from PDB servers.
prot = parsePDB('5uoj') #returns an AtomGroup object
prot #typing in variable name will give some information
We can use tab completion to inspect the prot object:
[Link]<TAB>
[Link]() #returns number of atoms
[Link]() #returns number of models
[Link]() #water molecules also count as residues
Similar to parsers, analysis function names start with calc:
Let’s read documentation of calcGyradius() function and use it to calculate the radius of
gyration (pl: promień bezwładności) of prot structure.
Plotting
We can use showProtein() function
to make a quick plot of prot structure:
showProtein(prot)
Atom Groups
parsePDB() function returns structure data as an AtomGroup object. You can also parse a list of .pdb files
into a list of AtomGroup objects:
groups = parsePDB('5uoj', '3h5v') pdb_ids = ['5uoj', '3h5v']
groups groups = parsePDB(pdb_ids)
groups
Data from this object can be retrieved using get methods. For example:
[Link]()
[Link]()
Indexing and slicing
An individual atom can be accessed by indexing AtomGroup objects:
atom = prot[0]
atom
It is also possible to get a slice of an AtomGroup. For example, we can get every other atom as follows:
prot[::2]
prot[:10]
Hierarchical view
You can also access specific chains or residues in an atom group. Indexing by a single letter
identifier will return a Chain instance:
prot['A']
Indexing atom group with a chain identifier and a residue number will return Residue instance:
prot['A', 100]
Keyword selection
structure = parsePDB('1p38')
protein = [Link]('protein')
protein
Using the protein keyword we selected 2833 atoms out of 2962 atoms.
Select by name/type
We can select backbone atoms by passing atom names following name keyword:
backbone = [Link]('protein and name N CA C O')
Backbone
Alternatively, we can use backbone to make the same selection:
backbone = [Link]('backbone')
We select acidic and basic residues by using residue names with resname keyword:
charged = [Link]('resname ARG LYS HIS ASP GLU')
Charged
set([Link]())
Union
Let’s select β-carbon atoms for non-GLY amino acid residues, and α-carbons for GLYs in two
steps:
betas = [Link]('name CB and protein')
gly_alphas = [Link]('name CA and resname GLY')
betas_gly_alphas = betas | gly_alphas
Intersection
It is as easy to get the intersection of two selections. Let’s find charged and medium size
residues in a protein:
charged = [Link]('charged')
medium = [Link]('medium')
medium_charged = medium & charged
Inversion
It is also possible to invert a selection:
only_protein = [Link]('protein')
only_non_protein = ~only_protein
water = [Link]('water')
The above shows that 1p38 does not contain any non-water hetero atoms.
Addition
Another operation defined on the Select object is addition (also on
other AtomPointer derived classes).
protein = [Link]('protein')
water = [Link]('water')
water_protein = water + protein
writePDB('1p38_water_protein.pdb', water_protein)
Equality
You can also check the equality of selections. Comparison will return True if both selections
refer to the same atoms.
calpha = [Link]('protein and name CA')
calpha2 = [Link]('calpha')
calpha == calpha2
ProDy Verbosity
ProDy prints some information to the console after parsing a file or doing some calculations. For
example, PDB parser will print what was parsed and how long it took to the screen:
@> 5uoj (./[Link]) is found in the target directory.
@> 2962 atoms and 1 coordinate sets were parsed in 0.08s.
The level of verbosity can be controlled using confProDy() function, and calling it
as confProDy(verbosity='none') will stop all information messages permanently.
Other values: (‘critical’, ‘debug’, ‘error’, ‘info’, ‘none’, ‘progress’, or ‘warning’)
Exercise 1
Load a protein called 1EJG and get its properties (using prody manual
[Link]
• Number of atoms
• Geometric center of protein
• Anisotropic displacement parameters
• Atom closest to center (residue and name)
• Euclidean distance between atom 1 and 50
Exercise 2
Make an array of indexes of all:
• ND2
• NH2
• OD1
atoms of 1H21 molecule.
Exercise 3
Draw a plot of 1H21 protein, with
only chain A, water and HEC
atoms. Try to get to reference
image as close as possible (tip:
use matplotlib syntax).