reading SSBOND corrected
authorCezary Czaplewski <czarek@chem.univ.gda.pl>
Tue, 9 Jan 2018 22:27:32 +0000 (23:27 +0100)
committerCezary Czaplewski <czarek@chem.univ.gda.pl>
Tue, 9 Jan 2018 22:27:32 +0000 (23:27 +0100)
TODO
django_simple/todo/templates/changelog.html
django_simple/todo/templates/input.html
django_simple/todo/views.py

diff --git a/TODO b/TODO
index 91e3c61..7cd4ad6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -28,7 +28,8 @@ homology restraints input
 
 other restrains input
 
-SAXS input
+# SAXS input
+# done
 
 automatic secondary structure restrains (psipred)
 
index 49d1e6b..885d7fc 100644 (file)
  <dd>
  Autorefresh added to job status page and job index page.
  </dd>
-
  <dd>
  Changelog page added.
  </dd>
 
+<dt>10.01.2018</dt>
+ <dd>
+ Reading SSBOND from multichain pdb corrected.
+ </dd>
  
 </dl>
               
index 431ca85..1509f69 100644 (file)
@@ -21,10 +21,8 @@ external software or online servers (for example Modeller software, Modloop
 server).
 <li>
 Disulfide bonds are read from PDB based on SSBOND records and for multichain
-protein COMPND record with propers CHAIN: tokens listing all chains in the
-PDB file. See example:
+protein proper chain records are necessary. See example:
 <pre>
-COMPND   3 CHAIN: A, B, C, D;
 SSBOND   1 CYS C  107    CYS C  138
 SSBOND   2 CYS C  124    CYS C  139
 SSBOND   3 CYS C  137    CYS C  149
index a29ae69..6a244b0 100644 (file)
@@ -47,32 +47,24 @@ def from_pdb(file):
     chain_start = {}
     chain_end = {}
     unres_shift = {}
-    chain=[]
-    ichain=0
+    chain_sorted=[]
     newchain = True
     
     for line in file:
-            if line[0:6] == 'COMPND' and line[11:17] == 'CHAIN:':
-              tmp=line[18:]
-              chain_=tmp.split(', ')
-              chain_[-1]=chain_[-1][0]
-              chain.extend(chain_)
-    
             if line[0:6] == 'ATOM  ' and line[13:15] == 'CA':
               aa = three_to_one.get(line[17:20])
               i = int(line[22:26])
+              ch = line[21:22]
               if newchain or i!=ires[-1]:
                 sequence.append(aa)
                 ires.append(i)
                 if newchain:
-                 if len(chain)>0:
-                  chain_start[chain[ichain]]=i
+                 chain_start[ch]=i
+                 chain_sorted.extend(ch)
                  newchain = False
             if line[0:3] == 'TER':
               sequence.append('XX')
-              if len(chain)>0:
-               chain_end[chain[ichain]]=i
-              ichain=ichain+1
+              chain_end[ch]=i
               newchain = True
             if line[0:6] == 'SSBOND':
               b=[]
@@ -85,6 +77,8 @@ def from_pdb(file):
               ssbond_ch.append(c)                                                                      
             if line[0:3] == 'END':
               break
+    if not sequence[-1] == 'XX':
+            chain_end[ch]=i
     while sequence[-1] == 'XX':
             del sequence[-1]
     if sequence[0] != 'G':
@@ -96,7 +90,7 @@ def from_pdb(file):
 #    if ires[0] != 1:
 #            ssbond=[ [e[0]-ires[0]+1,e[1]-ires[0]+1] for e in ssbond]
     i=0
-    for c in chain:
+    for c in chain_sorted:
       unres_shift[c]=i+chain_start[c]
       i=i-(chain_end[c]-chain_start[c])-3
     ssbond=[ [e[0]-unres_shift[c[0]]+1,e[1]-unres_shift[c[1]]+1] for e,c in zip(ssbond,ssbond_ch)]