diff --git a/orthofinder/orthofinder.py b/orthofinder/orthofinder.py index f04594ba00c66c46d31934975a8c903cb5cc5c4c..bdb5e58375f0f9b98e89c0c67fcf5384574ac44f 100755 --- a/orthofinder/orthofinder.py +++ b/orthofinder/orthofinder.py @@ -821,7 +821,7 @@ def PrintHelp(prog_caller): print("WORKFLOW RESTART COMMANDS:") print(" -b <dir> Start OrthoFinder from pre-computed BLAST results in <dir>") print(" -N <dir> Normalize Blast scores from pre-computed BLAST results in <dir>, then exit") - print(" -NF <dir> Normalize Blast scores from pre-computed BLAST results in <dir>, fix self-hits 0.0 values, then exit") + print(" -NZ <dir> Normalize Blast scores from pre-computed BLAST results in <dir>, compute back normalized self-hits values (0.0) (++ time consuming), then exit") print(" -fg <dir> Start OrthoFinder from pre-computed orthogroups in <dir>") print(" -ft <dir> Start OrthoFinder from pre-computed gene trees in <dir>") @@ -951,9 +951,9 @@ def ProcessArgs(prog_caller): util.Fail() options.qNormalize = True continuationDir = GetDirectoryArgument(arg, args) - elif arg == "-NF" or arg == "--normalize-fix": + elif arg == "-NZ" or arg == "--normalize-zero-hits": if options.qNormalizeAndFixZeros: - print("Repeated argument: -NF/--normalize-fix\n") + print("Repeated argument: -NZ/--normalize-zero-hits\n") util.Fail() options.qNormalize = True options.qNormalizeAndFixZeros = True diff --git a/orthofinder/scripts/blast_file_processor.py b/orthofinder/scripts/blast_file_processor.py index ea41e9fb4b23b3a327fd93b90d862fe2a400e2d6..72a6952df035760e0ffa03c524248860b24ffb7d 100644 --- a/orthofinder/scripts/blast_file_processor.py +++ b/orthofinder/scripts/blast_file_processor.py @@ -144,7 +144,7 @@ def WriteFixNormalizedBlastFile(blastDir_list, iSpecies, jSpecies, sep = "_", qD if iSpeciesOpen == jSpeciesOpen: for d in blastDir_list: fnNorm = d + "Blast%d_%d.norm.blastout" % (iSpeciesOpen, jSpeciesOpen) - fnNormFix = d + "Blast%d_%d.norm.fix.blastout" % (iSpeciesOpen, jSpeciesOpen) + fnNormFix = d + "Blast%d_%d.norm.nz.blastout" % (iSpeciesOpen, jSpeciesOpen) if os.path.exists(fnNorm): break try: with open(fnNorm, file_read_mode) as blastfile: diff --git a/orthofinder/scripts/scnorm.py b/orthofinder/scripts/scnorm.py index bb8e736e3530d4cf4c58fcabdb530cc6f700dc8b..750fa50a214421ed0120d9196c2367dc5b4c280d 100644 --- a/orthofinder/scripts/scnorm.py +++ b/orthofinder/scripts/scnorm.py @@ -160,17 +160,18 @@ class scnorm: newrows = [] # retrieve value from plot https://code-examples.net/en/q/8863d1 all_plots = f[jSpeciesOpen][0].get_xydata() - print(repr(all_plots)) + error_margin = 0.1 + #print(repr(all_plots)) line = 0 for row in rows: try: if row[12] == selfHitNormBlastScore: try: x = float(row[11]) - x = np.format_float_scientific(x, precision=8, unique=False, trim='k') + #x = np.format_float_scientific(x, precision=8, unique=False, trim='k') for index, value in all_plots: - if index == x: - NormBS = value + if x-error_margin <= index <= x+error_margin: + NormBS = float(value) break row[12] = NormBS except (IndexError, ValueError):