diff spring_package/Modeller.py @ 41:f316caf098a6 draft default tip

"planemo upload commit 685e1236afde7cf6bb0c9236de06998d2c211dd3"
author guerler
date Mon, 01 Mar 2021 15:02:36 +0000
parents 06337927c198
children
line wrap: on
line diff
--- a/spring_package/Modeller.py	Sat Jan 23 14:42:46 2021 +0000
+++ b/spring_package/Modeller.py	Mon Mar 01 15:02:36 2021 +0000
@@ -85,7 +85,7 @@
     templateIndex = 0
     for i in range(len(alignment)):
         t = templateAlign[i]
-        if alignment[i] == ":":
+        if alignment[i] in [":", "."]:
             templateResidue = templateResidues[templateIndex]
             templateResidue["alignedResidue"] = modelAlign[i]
             aligned.append(templateResidue)
@@ -112,7 +112,7 @@
         if templateHit["score"] < minScore or maxTries == 0:
             break
         maxTries = maxTries - 1
-        yield templateHit["templatePair"]
+        yield templateHit["templatePair"], templateHit["score"]
 
 
 def createModel(args):
@@ -139,7 +139,7 @@
     maxInfo = None
     minScore = float(args.minscore)
     maxTries = int(args.maxtries)
-    for [aTemplate, bTemplate] in getFrameworks(aTemplates, bTemplates, crossReference, minScore=minScore, maxTries=maxTries):
+    for [aTemplate, bTemplate], zscore in getFrameworks(aTemplates, bTemplates, crossReference, minScore=minScore, maxTries=maxTries):
         print("Evaluating Complex Template: %s." % aTemplate)
         templateFile = "temp/template.pdb"
         createPDB(aTemplate, pdbDatabase, templateFile)
@@ -168,6 +168,7 @@
                     print(str(e))
                     continue
                 biomolFound = True
+                print("  zscore:\t%5.2f" % zscore)
                 tmscore = min(coreScore, partnerScore)
                 print("  tmscore:\t%5.2f" % tmscore)
                 energy = -interfaceEnergy.get(coreAligned, partnerAligned)
@@ -178,7 +179,7 @@
                 print("  springscore:\t%5.2f" % springscore)
                 if springscore > maxScore and clashes < args.maxclashes:
                     maxScore = springscore
-                    maxInfo = dict(springscore=springscore, tmscore=tmscore, energy=energy, clashes=clashes)
+                    maxInfo = dict(aTemplate=aTemplate, bTemplate=bTemplate, springscore=springscore, tmscore=tmscore, energy=energy, clashes=clashes, zscore=zscore)
                     coreMolecule.save(outputName, chainName="0")
                     partnerMolecule.save(outputName, chainName="1", append=True)
                     if args.showtemplate == "true":
@@ -188,7 +189,7 @@
     if maxInfo is not None:
         print("Final Model:")
         for key in maxInfo:
-            print("  %s:\t%5.2f" % (key, maxInfo[key]))
+            print("  %s:\t%s" % (key, maxInfo[key]))
         print("Completed.")
     else:
         print("Warning: Failed to determine model.")