From ea3105bb15eaf94f79016435bdfdcb8c5b82a7f2 Mon Sep 17 00:00:00 2001
From: remy <remy.dernat@umontpellier.fr>
Date: Sun, 24 Nov 2019 19:12:13 +0100
Subject: [PATCH] 0.0 ...

---
 orthofinder/scripts/blast_file_processor.py |  4 +++-
 orthofinder/scripts/scnorm.py               | 18 ++++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/orthofinder/scripts/blast_file_processor.py b/orthofinder/scripts/blast_file_processor.py
index a22ad19..fea78cb 100644
--- a/orthofinder/scripts/blast_file_processor.py
+++ b/orthofinder/scripts/blast_file_processor.py
@@ -141,7 +141,9 @@ def WriteNormalizedBlastFile(blastDir_list, B, iSpecies, jSpecies, sep = "_", qD
                     raise
                 try:
                     newscore = B[sequence1ID, sequence2ID]
-                    #if newscore == 0.0:
+                    if newscore == 0.0:
+                        sys.stderr.write("\nERROR: 0.0 value detected !\n")
+
                     #    newscore = sc.scnorm.FixZeroNormalizedScores(iSpeciesOpen, float(row[11]))
                     row.append(newscore)
                 except IndexError as e:
diff --git a/orthofinder/scripts/scnorm.py b/orthofinder/scripts/scnorm.py
index 1f60037..b6b041b 100644
--- a/orthofinder/scripts/scnorm.py
+++ b/orthofinder/scripts/scnorm.py
@@ -34,7 +34,7 @@ import matplotlib.pyplot as plt                 # install
 
 
 counter=0
-curvefitplt=[]
+#curvefitplt=[]
 
 """
 scnorm
@@ -104,13 +104,14 @@ class scnorm:
     @staticmethod
     def DrawLogLinear(params, x):
         global counter
-        global curvefitplt
+        #global curvefitplt
         nbvals=5000
         maxBS=2500
         minBS=0
         x = np.linspace(minBS, maxBS, nbvals)
-        plot = plt.plot(x, scnorm.loglinear(x, *params), label='species '+str(counter))
-        curvefitplt.append(plot)
+        plt.plot(x, scnorm.loglinear(x, *params), label='species '+str(counter))
+        #plot = plt.plot(x, scnorm.loglinear(x, *params), label='species '+str(counter))
+        #curvefitplt.append(plot)
         plt.legend()
         plt.xlabel('Bits Scores')
         plt.ylabel('Normalized Scores')
@@ -119,7 +120,8 @@ class scnorm:
         plt.savefig('fitting_curve.png')
         counter+=1
 
-    @staticmethod
-    def FixZeroNormalizedScores(species, x):
-        NormBS = curvefitplt[species][int(x)].get_data()
-        return NormBS
+    #@staticmethod
+    #def FixZeroNormalizedScores(species, x):
+        # https://code-examples.net/en/q/8863d1
+        #NormBS = curvefitplt[species][int(x)].get_data()
+        #return NormBS
-- 
GitLab