ssbond with 1st res <> 1
[django_unres.git] / django_simple / todo / views.py
index 7341c93..37f4dd1 100644 (file)
@@ -34,10 +34,13 @@ def seq_add_x(sequence):
 def from_pdb(file):
     sequence = []
     ssbond = []
+    ires = []
     for line in file:
             if line[0:6] == 'ATOM  ' and line[13:15] == 'CA':
               aa = three_to_one.get(line[17:20])
               sequence.append(aa)
+              i = int(line[24:26])
+              ires.append(i)
             if line[0:3] == 'TER':
               sequence.append('XX')
             if line[0:6] == 'SSBOND':
@@ -56,6 +59,9 @@ def from_pdb(file):
     if sequence[-1] != 'G':
             sequence.append('X')
     seq=''.join(sequence)
+    if ires[0] != 1:
+            ssbond=[ [e[0]-ires[0]+1,e[1]-ires[0]+1] for e in ssbond]
+
     return seq,ssbond
 
 
@@ -125,6 +131,7 @@ def add_min_a(request,task_id):
              task.min_pdbout=form.cleaned_data["min_pdbout"]
              task.myfile1=form.cleaned_data["file1"]
              task.min_unres_pdb=form.cleaned_data["min_unres_pdb"]
+             task.unres_ff=form.cleaned_data["unres_ff"]
 
              seq,task.ssbond=from_pdb(task.myfile1)
              task.md_seq=""
@@ -222,7 +229,7 @@ def add_md_a(request,task_id):
              task.md_tau=form.cleaned_data["md_tau"]
              task.md_scal_fric=form.cleaned_data["md_scal_fric"]
              task.md_mdpdb=form.cleaned_data["md_mdpdb"]
-
+             task.unres_ff=form.cleaned_data["unres_ff"]
              
              task.ready=True
              basename = str(task.owner)
@@ -249,6 +256,7 @@ def add_remd(request,task_id):
              task.md_start=form.cleaned_data["md_start"]
              task.myfile1=form.cleaned_data["file1"]
              task.md_pdbref=form.cleaned_data["md_pdbref"]
+             task.md_ntwx=task.remd_nstex 
 
              task.md_seq=""
              if task.md_start == "pdbstart" or task.md_pdbref:
@@ -312,10 +320,13 @@ def add_remd_a(request,task_id):
              task.md_scal_fric=form.cleaned_data["md_scal_fric"]
              task.remd_nrep=form.cleaned_data["remd_nrep"]
              task.remd_nstex=form.cleaned_data["remd_nstex"]
+             task.md_ntwx=form.cleaned_data["md_ntwx"]             
+             task.md_ntwe=form.cleaned_data["md_ntwe"]
 #             task.remd_traj1file=form.cleaned_data["remd_traj1file"]
 #             task.remd_rest1file=form.cleaned_data["remd_rest1file"]
 
              task.remd_cluter_temp=form.cleaned_data["remd_cluter_temp"]
+             task.unres_ff=form.cleaned_data["unres_ff"]
              
              basename = str(task.owner)
              suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
@@ -430,9 +441,9 @@ def refresh_done(request):
                  if 'RMSD of  the common residues=' in line:
                    text=' RMSD='+line.split()[5]
                  if 'TM-score    =' in line:
-                   text=text+' TM-score='+line.split()[2]
+                   text=text+' TMscore='+line.split()[2]
                  if 'GDT-TS-score=' in line:
-                   text=text+' GDT-TS='+line.split()[1]
+                   text=text+' GDT_TS='+line.split()[1]
                     
                if i==1:
                      task.remd_model1=task.remd_model1+text