diff --git a/orthofinder/scripts/blast_file_processor.py b/orthofinder/scripts/blast_file_processor.py index a22ad1964e951bc82658d9f68c5326e15aa195f4..fea78cb1b1a8940502bc390811c35a41b9a9a927 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 1f6003733d26af07b226477bd7eb6182224e831e..b6b041bc1056778366492c75e89345e7dddb74eb 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