Extend a coarse-grained model

This example shows how to extend normal modes calculated for a coarse-grained model to a larger set of atoms. Extended model can be used to generate alternate conformers that can be saves in PDB format.

We start by importing everything from the ProDy package:

In [1]: from prody import *

In [2]: from matplotlib.pylab import *

In [3]: ion()

Conformers can be generated along any set of normal modes. In this example, we will calculate normal modes for the unbound structure of p38 MAP kinase and generate backbone trace conformations.

In [4]: p38 = parsePDB('1p38')

In [5]: p38_ca = p38.select('calpha')

In [6]: anm = ANM('1p38')

In [7]: anm.buildHessian(p38_ca)

In [8]: anm.calcModes()


ANM modes are extended using the extendModel() function:

In [9]: bb_anm, bb_atoms = extendModel(anm, p38_ca, p38.select('backbone'))

In [10]: bb_anm
Out[10]: <NMA: Extended ANM 1p38 (20 modes; 1404 atoms)>

In [11]: bb_atoms
Out[11]: <AtomMap: Selection 'backbone' from 1p38 (1404 atoms)>

Note that GNM, PCA, and NMA instances can also be used as input to this function.

Write NMD file

Extended modes can be visualized in VMD using Normal Mode Wizard using an NMD file:

In [12]: writeNMD('p38_anm_backbone.nmd', bb_anm, bb_atoms)
Out[12]: 'p38_anm_backbone.nmd'

Sample conformers

We can use the extended model to sample backbone conformers:

In [13]: ensemble = sampleModes(bb_anm[:3], bb_atoms, n_confs=40, rmsd=0.8)

In [14]: ensemble
Out[14]: <Ensemble: Conformations along 3 modes from NMA Extended ANM 1p38 (40 conformations; 1404 atoms)>

Note that we made use of ANM modes to generate full atomic conformers. These conformers would need geometry optimization before they can be used for modeling.

Write PDB file

Generated conformers can be written in PDB format as follows:

In [15]: backbone = bb_atoms.copy()

In [16]: backbone.addCoordset(ensemble)

In [17]: writePDB('p38_backbone_ensemble.pdb', backbone)
Out[17]: 'p38_backbone_ensemble.pdb'