changeset 13:66277925a124

Uploaded
author estrain
date Sat, 07 Sep 2019 11:12:04 -0400
parents b43b7ef0df6a
children 6d28f83c35b1
files SeqSero2_package.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/SeqSero2_package.py	Sat Sep 07 08:19:53 2019 -0400
+++ b/SeqSero2_package.py	Sat Sep 07 11:12:04 2019 -0400
@@ -12,6 +12,7 @@
 import itertools
 from distutils.version import LooseVersion
 from distutils.spawn import find_executable
+import math
 
 try:
     from .version import SeqSero2_version
@@ -518,6 +519,8 @@
         for z in range(len(handle[i].alignments[j].hsps)):
           hsp=handle[i].alignments[j].hsps[z]
           temp=set(range(hsp.query_start,hsp.query_end))
+          # Bit score is not parsed correctly, calculate it from raw score
+          est_bit=(handle[i].ka_params[0]*hsp.score-math.log(handle[i].ka_params[1]))/(math.log(2))
           if len(cover_region)==0:
             cover_region=cover_region|temp
             fraction=1
@@ -525,10 +528,12 @@
             fraction=1-len(cover_region&temp)/float(len(temp))
             cover_region=cover_region|temp
           if "last" in handle[i].query or "first" in handle[i].query:
-            score+=hsp.bits*fraction
+            #score+=hsp.bits*fraction
+            score+=est_bit*fraction
             ids+=float(hsp.identities)/handle[i].query_length*fraction
           else:
-            score+=hsp.bits*fraction
+            #score+=hsp.bits*fraction
+            score+=est_bit*fraction
             ids+=float(hsp.identities)/handle[i].query_length*fraction
         List_score.append(score)
         List_ids.append(ids)