**Reference **

Bakan A, Bahar I. The intrinsic dynamics of enzymes plays a dominant role in determining the structural changes induced upon inhibitor binding. Proc Natl Acad Sci U S A. 2009 106(34):14349-54.

In [1]:

```
from prody import *
from pylab import *
%matplotlib inline
```

In [2]:

```
p38 = parsePDB('1p38')
```

In [3]:

```
p38_sequence = p38.getHierView()['A'].getSequence()
```

In [4]:

```
p38_sequence
```

Out[4]:

'ERPTFYRQELNKTIWEVPERYQNLSPVGSGAYGSVCAAFDTKTGHRVAVKKLSRPFQSIIHAKRTYRELRLLKHMKHENVIGLLDVFTPARSLEEFNDVYLVTHLMGADLNNIVKCQKLTDDHVQFLIYQILRGLKYIHSADIIHRDLKPSNLAVNEDCELKILDFGLARHTDDEMTGYVATRWYRAPEIMLNWMHYNQTVDIWSVGCIMAELLTGRTLFPGTDHIDQLKLILRLVGTPGAELLKKISSESARNYIQSLAQMPKMNFANVFIGANPLAVDLLEKMLVLDSDKRITAAQALAHAYFAQYHDPDDEPVADPYDQSFESRDLLIDEWKSLTYDEVISFVPPPLD'

In [5]:

```
blast_record = blastPDB(p38_sequence)
```

@> Blast searching NCBI PDB database for "ERPTF..." @> Blast search completed in 6.5s.

In [6]:

```
pdbids = blast_record.getHits()
```

In [7]:

```
pdbfiles = fetchPDB(*pdbids, compressed=False)
```

In [8]:

```
ref_structure = parsePDB('1p38')
ref_selection = ref_structure.select('resnum 5 to 31 36 to 114 122 to '
'169 185 to 351 and calpha')
```

In [9]:

```
ref_chain = ref_selection.getHierView().getChain('A')
repr(ref_chain)
```

Out[9]:

'<Chain: A from 1p38 (321 residues, 321 atoms)>'

In [10]:

```
ensemble = PDBEnsemble('p38 X-ray')
```

In [11]:

```
ensemble.setAtoms(ref_chain)
ensemble.setCoords(ref_chain)
```

In [12]:

```
for pdbfile in pdbfiles:
structure = parsePDB(pdbfile, subset='calpha')
mappings = mapOntoChain(structure, ref_chain)
atommap = mappings[0][0]
ensemble.addCoordset(atommap, weights=atommap.getFlags('mapped'), degeneracy=True)
```

In [13]:

```
repr(ensemble)
```

Out[13]:

'<PDBEnsemble: p38 X-ray (237 conformations; 321 atoms)>'

In [14]:

```
print len(ensemble) == len(pdbfiles)
```

True

In [15]:

```
ensemble.iterpose()
```

In [16]:

```
pca = PCA('p38 xray') # Instantiate a PCA instance
pca.buildCovariance(ensemble) # Build covariance for the ensemble
pca.calcModes() # Calculate modes (20 of the by default)
```

In [17]:

```
anm = ANM('1p38') # Instantiate a ANM instance
anm.buildHessian(ref_chain) # Build Hessian for the reference chain
anm.calcModes() # Calculate slowest non-trivial 20 modes
```

@> Hessian was built in 0.20s. @> 20 modes were calculated in 0.12s.

In [18]:

```
saveModel(pca)
saveModel(anm)
saveEnsemble(ensemble)
```

Out[18]:

'p38_ref_chain.pdb'

In [19]:

```
for mode in pca[:3]: # Print % variance explained by top PCs
var = calcFractVariance(mode)*100
print('{0:s} % variance = {1:.2f}'.format(mode, var))
```

In [20]:

```
for mode in pca[:3]: # Print PCA mode collectivity
coll = calcCollectivity(mode)
print('{0:s} collectivity = {1:.2f}'.format(mode, coll))
```

In [21]:

```
for mode in anm[:3]: # Print ANM mode collectivity
coll = calcCollectivity(mode)
print('{0:s} collectivity = {1:.2f}'.format(mode, coll))
```

In [22]:

```
printOverlapTable(pca[:3], anm[:3]) # Top 3 PCs vs slowest 3 ANM modes
```

In [23]:

```
showOverlapTable(pca[:6], anm[:6]);
title('PCA - ANM Overlap Table');
```

In [24]:

```
showOverlap(pca[0], anm);
```

In [25]:

```
showCumulOverlap(pca[0], anm);
```

In [26]:

```
showSqFlucts(pca[:3]);
```

In [27]:

```
showSqFlucts(anm[:3]);
```

In [28]:

```
showScaledSqFlucts(pca[0], anm[2]);
legend();
```

In [29]:

```
showNormedSqFlucts(pca[0], anm[1]);
legend();
```

In [30]:

```
showCrossCorr(anm)
```

Out[30]:

(<matplotlib.image.AxesImage at 0x10f9c5350>, <matplotlib.colorbar.Colorbar at 0x10e8e30d0>)

In [31]:

```
showCrossCorr(pca)
```

Out[31]:

(<matplotlib.image.AxesImage at 0x10fe64490>, <matplotlib.colorbar.Colorbar at 0x10fea6b10>)

In [32]:

```
writeNMD('p38_anm.nmd',anm,ref_chain)
```

Out[32]:

'p38_anm.nmd'

In [33]:

```
writeNMD('p38_pca.nmd',pca,ref_chain)
```

Out[33]:

'p38_pca.nmd'

In [ ]:

```
```