Permalink
Browse files

Added new tutorial example.

  • Loading branch information...
1 parent 8363095 commit ace53a5fb2140035639d0733d9b6876d6a7acf08 @abakan abakan committed Jun 4, 2012
Showing with 202 additions and 23 deletions.
  1. +72 −3 doc/tutorial/basics.rst
  2. +62 −0 doc/tutorial/commands.rst
  3. +68 −20 doc/tutorial/nmwiz.rst
View
@@ -130,7 +130,7 @@ For more details on atomic objects see :ref:`atomic`.
parsers for other file types (e.g. mol2) can be developed. The example in
:ref:`atomgroup` can be helpful to this aim.
-Atomic data
+Atomic Data
===============================================================================
:func:`.parsePDB` returns data in an :class:`.AtomGroup` instance.
@@ -221,7 +221,7 @@ successfully written. This is a general behavior for ProDy output functions.
For more PDB writing examples see :ref:`writepdb`.
-Atom selections
+Atom Selections
===============================================================================
:class:`.AtomGroup` instances have a plain view of atoms for efficiency,
@@ -335,9 +335,78 @@ or changing the source code. See the following pages:
* :ref:`contacts` for selecting interacting atoms
-Measure and Transform
+Analyze Structures
===============================================================================
+Measure geometric properties
+-------------------------------------------------------------------------------
+
+ProDy offers several functions for analyzing molecular structure in
+:mod:`.measure` module. For example, you can calculate phi (φ) and psi (ψ)
+for the 10th residue, or the radius of gyration of the protein as follows:
+
+>>> print calcPhi(structure[10,]).round(2)
+-115.54
+>>> print calcPsi(structure[10,]).round(2)
+147.49
+>>> print calcGyradius(structure).round(2)
+22.06
+
+Most functions start with ``calc`` prefix. You can type in ``calc`` and press
+tab to see what is available in an IPython session.
+
+Compare chains
+-------------------------------------------------------------------------------
+
+You can also compare different structures using some of the methods in
+:mod:`.proteins` module. Let's parse another p38 MAP kinase structure
+
+>>> bound = parsePDB('1zz2')
+
+You can find similar chains in structure 1p38 and 1zz2 using
+:func:`.matchChains` function:
+
+>>> apo_chA, bnd_chA, seqid, overlap = matchChains(structure, bound)[0]
+>>> apo_chA
+<AtomMap: Chain A from 1p38 -> Chain A from 1zz2 from 1p38 (337 atoms)>
+>>> bnd_chA
+<AtomMap: Chain A from 1zz2 -> Chain A from 1p38 from 1zz2 (337 atoms)>
+>>> print int(seqid) # precent sequence identity between two chains
+99
+>>> print int(overlap) # percent overlap between two chains
+96
+
+Matching Cα atoms are selected and returned as :class:`.AtomMap` instances.
+We can use them to calculate RMSD and superpose structures.
+
+>>> print calcRMSD(bnd_chA, apo_chA)
+72.9302308695
+>>> bnd_chA, transformation = superpose(bnd_chA, apo_chA)
+>>> print calcRMSD(bnd_chA, apo_chA)
+1.86280149087
+
+>>> plt.figure(figsize=(5,4)) # doctest: +SKIP
+>>> showProtein(structure) # doctest: +SKIP
+>>> showProtein(bound) # doctest: +SKIP
+>>> plt.legend(prop={'size': 10}) # doctest: +SKIP
+
+.. plot::
+ :context:
+
+ import matplotlib.pyplot as plt
+ bound = parsePDB('1zz2')
+ matchAlign(structure, bound)
+ plt.figure(figsize=(5,4))
+ showProtein(structure)
+ showProtein(bound)
+ plt.legend(prop={'size': 10})
+
+
+.. plot::
+ :nofigs:
+ :context:
+
+ plt.close('all')
ProDy Verbosity
View
@@ -3,3 +3,65 @@
*******************************************************************************
Commands Tutorial
*******************************************************************************
+
+You can use :ref:`commands` to perform some automated tasks, such as
+ANM/GNM/PCA calculations, fetching and aligning PDB files, making atom
+selections, or identify contacts. ProDy commands are handled by a script
+that comes with all installation packages. You can run the script
+from a central location such as :file:`/usr/local/bin`::
+
+ $ prody -h
+
+or from the current working directory::
+
+ $ ./prody -h
+
+or::
+
+ $ python prody -h
+
+or on Windows::
+
+ $ C:\Python27\python.exe C:\Python27\Scripts\prody -h
+
+These lines will print available ProDy commands. You can get more help
+on a specific commands as follows::
+
+ $ prody anm -h
+
+Some usage example are:
+
+Align PDB files
+===============================================================================
+
+:ref:`prody-align` command can be used to download and align structures for
+given PDB identifiers::
+
+ $ prody align 1p38 1r39 1zz2
+
+Structures will be automatically downloaded from wwPDB FTP servers and saved
+in the current working directory. Additionally, you can configure ProDy
+to use a local mirror of PDB or to store downloaded files in a local folder.
+See :ref:`prody-basics` part of the tutorial.
+
+
+ANM calculations
+===============================================================================
+
+:ref:`prody-anm` can be used to perform ANM calculations::
+
+ $ prody anm 1p38 -a -A
+
+``-a`` and ``-A`` options will make ProDy output all data and figure files.
+
+
+PCA calculations
+===============================================================================
+
+:ref:`prody-anm` can be used to perform PCA calculations. The following
+example will perform PCA calculations for Cα atoms of the p38 MAP kinase
+using the trajectory file provided in :download:`p38 trajectory
+<p38_trajectory.tar.gz>`::
+
+ $ tar -xzf p38_trajectory.tar.gz
+ $ prody pca -a -A --select calpha --pdb p38.pdb p38_100frames.dcd
View
@@ -39,32 +39,27 @@ network model modes were calculated using ProDy. Movie was generated using
:width: 400
-Fetch PDB files
+Experiment vs. Theory
===============================================================================
-Let's fetch some PDB files that contain solution (NMR) and X-ray structure
-using :ref:`prody-fetch` command::
+We will use ProDy Interface of NMWiz plugin to perform a comparative analysis
+of ubiquitin dynamics predicted using theory using anisotropic network model
+(ANM) and inferred from experimental structures using principal component
+analysis (PCA).
- $ prody fetch 2k39 1dlo 1p38
+Let's fetch a PDB files that contains a solution (NMR) structure using
+:ref:`prody-fetch` command::
-Alternatively, you may use a browser to download these files.
+ $ prody fetch 2k39
-First, let's load :file:`2k39.pdb` file into VMD at startup as follows::
+Alternatively, you may use a browser to download these files.
+:file:`2k39.pdb` file can be loaded into VMD at startup as follows::
$ vmd 2k38.pdb
This file contains 116 solution structure models of the protein Ubiquitin, so
it will be suitable for comparison of theoretical predictions with experimental
-data.
-
-
-Experiment vs. Theory
-===============================================================================
-
-We will use ProDy Interface of NMWiz plugin to perform a comparative analysis
-of ubiquitin dynamics predicted using theory using anisotropic network model
-(ANM) and inferred from experimental structures using principal component
-analysis (PCA).
+data.
:guilabel:`NMWiz - Main` window can be accessed via the
:menuselection:`Extensions --> Analysis` menu of :guilabel:`VMD Main`
@@ -83,7 +78,7 @@ we are interested in.
We enter the selection string ``resid <= 70 and protein and name CA`` and
click :guilabel:`Select`. 70 Cα atoms will be selected for calculations.
-ANM Calculations
+ANM Calculation
-------------------------------------------------------------------------------
First, we perform ANM calculations, which is the job type selected by default.
@@ -103,7 +98,7 @@ This action will run :ref:`prody-anm` command in the background and load the
results when calculations are finished.
-PCA Calculations
+PCA Calculation
-------------------------------------------------------------------------------
Now, we will use all ubiquitin models for the PCa calculation. Select
@@ -144,7 +139,7 @@ Load the contents of this file into VMD as follows::
Click on :guilabel:`ProDy Interface` for performing ANM and EDA jobs.
-ANM Calculations
+ANM Calculation
-------------------------------------------------------------------------------
We will perform ANM calculations for all Cα atoms and keep the rest of the
@@ -159,7 +154,7 @@ parameters unchanged. Click :guilabel:`Submit Job` and results obtained from
EDA 1 (orange) vs. ANM mode 2 (lime green)
-EDA Calculations
+EDA Calculation
-------------------------------------------------------------------------------
Select :guilabel:`PCA Calculation` in the :guilabel:`ProDy Job Settings` panel.
@@ -196,3 +191,56 @@ calculations:
Extending a Model
===============================================================================
+
+In previous calculations, we used Cα atoms and the results retrieved from
+ProDy contained only a trace of the structure. VMD requires more information
+(at least a complete backbone) for displaying cartoon and ribbon
+representation of proteins which are suitable for publications. In this
+part, we will use :guilabel:`Extend model to` option for extending the
+model to backbone atoms of the protein.
+
+.. figure:: nmwiz_1dlo_ANM1.png
+ :align: right
+ :scale: 50 %
+ :target: ../_images/nmwiz_1dlo_ANM1.png
+
+ ANM mode 1 for HIV Reverse Transcriptase
+
+ANM Calculation
+-------------------------------------------------------------------------------
+
+Let's fetch an X-ray structure of the protein HIV reverse transcriptase (RT)
+and load into VMD::
+
+ $ prody fetch 1dlo
+ $ vmd 1dlo.pdb
+
+In the :guilabel:`ProDy Interface`, we select :guilabel:`ANM Calculation`,
+check :guilabel:`backbone` option, and click :guilabel:`Submit Job`.
+Model will be calculated for 971 selected Cα atoms, but the normal modes will
+be extended to all backbone atoms.
+
+
+Visualization
+-------------------------------------------------------------------------------
+
+When the results are loaded, you will see four arrows per residue (or node).
+Change the :guilabel:`Selection` string to read ``name CA`` and click
+:guilabel:`Redraw`. This will draw only one arrow per mode.
+
+RT is a large structure and updating the display with every little change you
+make might be time consuming. You can uncheck :guilabel:`auto update graphics`
+option in :guilabel:`Mode Graphics Options` panel.
+
+To get the view displayed in the figure, you will need to hide arrows that
+are shorter than a given length using :guilabel:`Draw if longer than` option
+and draw an arrow for every forth residue using the selection
+``name CA and resid % 4 == 0``. The protein representation is *NewCartoon*.
+
+Animation
+-------------------------------------------------------------------------------
+
+You can generate a trajectory along the selected mode by clicking
+:guilabel:`Make` in :guilabel:`Animation` row. For large proteins,
+keeping the :guilabel:`Graphics resolution` low (10) will make
+the animation run smoother.

0 comments on commit ace53a5

Please sign in to comment.