In [12]:
import  prody as pd
import numpy as np

Задание 2. RMSF

In [74]:
nmr_model = pd.parsePDB('5zc6', segment='A')
@> PDB file is found in working directory (5zc6.pdb.gz).
@> 2701 atoms and 15 coordinate set(s) were parsed in 0.25s.
In [81]:
RMSFs = [np.mean(pd.calcRMSF(res)) for res in nmr_model.iterResidues()]
del RMSFs[165:168] #удаляем остатки которых нет в РСА
In [82]:
print(len(RMSFs))
166
In [83]:
xray_model = pd.parsePDB('121P', segment='A')
@> PDB file is found in working directory (121p.pdb.gz).
@> 1550 atoms and 1 coordinate set(s) were parsed in 0.06s.
In [84]:
pr_mass_center = pd.calcCenter(xray_model, weights=xray_model.getMasses())
distans = []
betas = []
In [85]:
for residue in xray_model.iterResidues():
    if "CA" in residue.getNames():  # if residue is an aminoacid
        mean_beta = np.mean(residue.getBetas())
        betas.append(mean_beta)
        
print(len(betas))        
166
In [87]:
import matplotlib.pyplot as plt
fig,ax = plt.subplots()
ax.scatter(betas, RMSFs, s=1)
ax.set_xlabel('Beta-factor')
ax.set_ylabel('RMSFs')
plt.plot()
#coef = np.polyfit(betas, RMSFs 2)
#equ = np.poly1d(coef)
#x_plot = np.linspace(0,50)
#y_plot = equ(distans)
#plt.plot(distans, y_plot, color='r')

fig.show()
plt.savefig('pr5_plot.png')
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:13: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  del sys.path[0]

Задание 3

In [96]:
NMR_prot = pd.parsePDB("5zc6")
bb_hb_dist = []
sc_hb_dist = []
loop_hb_dist = []

THR20 = NMR_prot["A", 20]["N"].getCoordsets()
LYS16 = NMR_prot["A", 16]["O"].getCoordsets()
SER17 = NMR_prot["A", 17]["OG"].getCoordsets()
ASP57_OD1 = NMR_prot["A", 57]["OD1"].getCoordsets()
ASP57_OD2 = NMR_prot["A", 57]["OD2"].getCoordsets()
ASN26 = NMR_prot["A", 26]["OD1"].getCoordsets()
ARG149_NH1 = NMR_prot["A", 149]["NH1"].getCoordsets()
ARG149_NH2 = NMR_prot["A", 149]["NH2"].getCoordsets()


for i in range(15):
    bb_hb_dist.append(pd.calcDistance(THR20[i], LYS16[i]))
    sc_hb_dist.append(min(pd.calcDistance(SER17[i], ASP57_OD1[i]), pd.calcDistance(SER17[i], ASP57_OD2[i])))
    loop_hb_dist.append(min(pd.calcDistance(ASN26[i], ARG149_NH1[i]), pd.calcDistance(ASN26[i], ARG149_NH2[i])))
@> PDB file is found in working directory (5zc6.pdb.gz).
@> 2701 atoms and 15 coordinate set(s) were parsed in 0.37s.
In [106]:
bb_pr = 0
sc_pr = 0
loop_pr = 0
for i in range(15):
    if bb_hb_dist[i] < 3.5:
        bb_pr+=1
    if sc_hb_dist[i] < 3.5:
        sc_pr+=1
    if loop_hb_dist[i] < 3.5:
        loop_pr+=1
In [121]:
print(f"Пара остатков      \tmin\tmax\tmedian \t hbonds \t percent hbonds\n\
THR20 и LYS16\t  \t{np.min(bb_hb_dist):.2f}\t{np.max(bb_hb_dist):.2f}\t{np.median(bb_hb_dist):.2f}\t{(bb_pr):.1f}\t\t{(bb_pr/15*100):.2f}\n\
SER17 и ASP57\t\t{np.min(sc_hb_dist):.2f}\t{np.max(sc_hb_dist):.2f}\t{np.median(sc_hb_dist):.2f}\t{(sc_pr):.1f}\t\t{(sc_pr/15*100):.2f}\n\
ASN26 и ARG149 \t  \t{np.min(loop_hb_dist):.2f}\t{np.max(loop_hb_dist):.2f}\t{np.median(loop_hb_dist):.2f}\t{(loop_pr):.1f}\t\t{(loop_pr/15*100):.2f}\n")
Пара остатков      	min	max	median 	 hbonds 	 percent hbonds
THR20 и LYS16	  	3.21	3.64	3.36	12.0		80.00
SER17 и ASP57		2.49	5.28	4.19	6.0		40.00
ASN26 и ARG149 	  	2.58	5.80	4.09	4.0		26.67

In [ ]:
 
In [ ]: