In [51]:
import prody as pd
import numpy as np
from matplotlib import pyplot as plt
In [47]:
nmr_str = pd.parsePDB('2Y4W')
xray_str = pd.parsePDB('2YB6')
@> Connecting wwPDB FTP server RCSB PDB (USA).
@> 2y4w downloaded (2y4w.pdb.gz)
@> PDB download via FTP completed (1 downloaded, 0 failed).
@> 2394 atoms and 20 coordinate set(s) were parsed in 0.16s.
@> Connecting wwPDB FTP server RCSB PDB (USA).
@> 2yb6 downloaded (2yb6.pdb.gz)
@> PDB download via FTP completed (1 downloaded, 0 failed).
@> 1338 atoms and 1 coordinate set(s) were parsed in 0.03s.
In [53]:
RMSFs = [np.mean(pd.calcRMSF(res)) for res in nmr_str.iterResidues()]
len(RMSFs)
Out[53]:
152
In [55]:
betas = [np.mean(res.getBetas()) for res in xray_str.iterResidues()]
Out[55]:
152
In [56]:
fig, ax = plt.subplots()
ax.scatter(RMSFs, betas[:152], s=1)
ax.set_xlabel('RMSF')
ax.set_ylabel('B-фактор')
fig.show
plt.savefig(fname='t3.png')
In [15]:
dist1 = [3.0, 2.8, 2.8, 3.2, 3.1, 2.8, 3.2, 3.0, 3.0, 2.7, 2.7, 3.0, 3.1, 3.0, 3.1, 3.0, 3.0, 3.0, 2.8, 2.8, 3.1, 2.9, 3.0]
In [31]:
print(max(dist1))
print(min(dist1))
3.2
2.7
In [17]:
len(dist1)
Out[17]:
23
In [29]:
med1 = sorted(dist1)[int(len(dist1) / 2) + 1]
med1
Out[29]:
3.0
In [39]:
dist3 = [3.1, 3.1, 3.2, 3.1, 2.9, 3.7, 3.3, 3.1, 3.1, 3.0, 2.9, 4.1, 3.1, 2.5, 2.7, 2.8, 3.2, 3.0, 3.3, 3.1, 3.5, 3.0, 2.9]
In [40]:
len(dist3)
Out[40]:
23
In [41]:
print(max(dist3))
print(min(dist3))
4.1
2.5
In [46]:
med3 = sorted(dist3)[int(len(dist3) / 2) + 1]
med3
Out[46]:
3.1
In [45]:
true_bonds3 = [1, 1, 0, 0, 1, 
              0, 0, 1, 1, 0, 
              0, 0, 1, 1, 1, 
              0, 0, 0, 0, 1, 
              1, 0, 0]
sum(true_bonds3)/23
Out[45]:
0.43478260869565216