fluct_plot multichain correction
authorCezary Czaplewski <czarek@chem.univ.gda.pl>
Wed, 13 Dec 2017 01:14:07 +0000 (02:14 +0100)
committerCezary Czaplewski <czarek@chem.univ.gda.pl>
Wed, 13 Dec 2017 01:14:07 +0000 (02:14 +0100)
and error message for missing residues

django_simple/todo/forms.py
files/fluct_plot.py

index 8fda381..0a8f597 100644 (file)
@@ -22,7 +22,7 @@ def pdb_missing_res(file):
                else:
                  msg = 'chain breaks between residues '+\
                    str(ires[-1])+' and '+str(i)+\
-                   ', server cannot add missing residues to PDB file'
+                   ', server cannot add missing residues to PDB file - please repair the structure using e.g. Modeller'
                  break
       if line[0:3] == 'TER':
                newchain = True
index 609ca4d..d228324 100755 (executable)
@@ -49,15 +49,19 @@ for i in range(1,natom+1):
    y.append(fluct)
 
 b=[]
-ires=''
+newchain=True
 if os.path.exists('plik.pdb'):
  with open('plik.pdb') as f:
    for line in f:
       if line[0:4]=='ATOM' and line[13:15]=='CA':
 #         print line
-        if ires=='' or int(line[22:26])>ires:
+        if newchain or int(line[22:26])>ires:
          b.append(math.sqrt(float(line[60:66])*3/8/math.pi/math.pi))
          ires=int(line[22:26])         
+         newchain=False
+      if line[0:3]=='TER':
+        newchain=True
+                        
 
 
 plt.xlabel('residue')