8 import matplotlib.pyplot as plt
19 with open(sys.argv[1]) as f:
21 if line[0:4]=='ATOM' and line[13:15]=='CA':
28 sx[iatom]=sx.get(iatom,0)+x
29 sy[iatom]=sy.get(iatom,0)+y
30 sz[iatom]=sz.get(iatom,0)+z
31 s2x[iatom]=s2x.get(iatom,0)+x*x
32 s2y[iatom]=s2y.get(iatom,0)+y*y
33 s2z[iatom]=s2z.get(iatom,0)+z*z
36 if line[0:6]=='ENDMDL':
43 for i in range(1,natom+1):
44 fluct=math.sqrt((s2x.get(i)-sx.get(i)*sx.get(i)/nmol\
45 +s2y.get(i)-sy.get(i)*sy.get(i)/nmol\
46 +s2z.get(i)-sz.get(i)*sz.get(i)/nmol )/nmol)
52 if os.path.exists('plik.pdb'):
53 with open('plik.pdb') as f:
55 if line[0:4]=='ATOM' and line[13:15]=='CA':
57 b.append(math.sqrt(float(line[60:66])*3/8/math.pi/math.pi))
62 plt.ylabel('fluctuations')
66 plt.plot(x,b,'-',c='red')
67 plt.legend(['fluctuations','sqrt(3*bfactor/8*pi^2)'])
68 plt.savefig('fluct_plot.png')