From 389d09347ccd792a792cb36b35cb425a835172fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dernat=20R=C3=A9my?= <remy.dernat@umontpellier.fr>
Date: Fri, 8 Nov 2019 15:46:48 +0100
Subject: [PATCH] Normalize option

---
 orthofinder/orthofinder.py   | 12 +++++++-----
 orthofinder/scripts/files.py |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/orthofinder/orthofinder.py b/orthofinder/orthofinder.py
index d7a4b59..46149b0 100755
--- a/orthofinder/orthofinder.py
+++ b/orthofinder/orthofinder.py
@@ -494,7 +494,7 @@ class WaterfallMethod:
     def ProcessBlastHits(seqsInfo, blastDir_list, Lengths, iSpecies, qDoubleBlast):
         with warnings.catch_warnings():         
             warnings.simplefilter("ignore")
-            # process up to the best hits for each species; Bi is a list of matrix
+            # process up to the best hits for each species; Bi is a list of matrices
             Bi = []
             for jSpecies in range(seqsInfo.nSpecies):
                 # getting Bit scores matrix for iSpecies on jSpecies
@@ -934,13 +934,13 @@ class Options(object):#
 def ProcessArgs(prog_caller):
     """ 
     Workflow
-    | 1. Fasta Files | 2. Prepare files | 3.a Blast | 3.b Normalize Blast scores | 4. Orthogroups | 5. Gene Trees | 6. Reconciliations/Orthologues |
+    | 1. Fasta Files | 2. Prepare files | 3 Blast | 3.b Normalize Blast scores | 4. Orthogroups | 5. Gene Trees | 6. Reconciliations/Orthologues |
 
     Options
     Start from:
     -f: 1,2,..,6    (start from fasta files, --fasta)
     -b: 4,5,6       (start from blast results, --blast)
-    -N: 3b          (start from blast results, --normalize)
+    -N: 3.b          (start from blast results, --normalize)
     -fg: 5,6        (start from orthogroups/do orthologue workflow, --from-groups)
     -ft: 6          (start from gene tree/do reconciliation, --from-trees)
     Stop at:
@@ -985,6 +985,7 @@ def ProcessArgs(prog_caller):
                 print("Repeated argument: -N/--normalize\n")
                 util.Fail()
             options.qNormalize = True
+            continuationDir = GetDirectoryArgument(arg, args)
         elif arg == "-fg" or arg == "--from-groups":
             if options.qStartFromGroups:
                 print("Repeated argument: -fg/--from-groups\n")
@@ -1174,8 +1175,8 @@ def ProcessArgs(prog_caller):
             util.Fail()    
     
     # check argument combinations       
-    if not (options.qStartFromFasta or options.qStartFromBlast or options.qStartFromGroups or options.qStartFromTrees):
-        print("ERROR: Please specify the input directory for OrthoFinder using one of the options: '-f', '-b', '-fg' or '-ft'.")
+    if not (options.qStartFromFasta or options.qStartFromBlast or options.qStartFromGroups or options.qStartFromTrees or options.qNormalize):
+        print("ERROR: Please specify the input directory for OrthoFinder using one of the options: '-f', '-b', '-N', '-fg' or '-ft'.")
         util.Fail()
     
     if options.qStartFromFasta and (options.qStartFromTrees or options.qStartFromGroups):
@@ -1379,6 +1380,7 @@ def DoNormalize(options, speciesInfoObj, seqsInfo):
     """
     DoNormalize is a lighweigth version of the DoOrthogroups function
     It will just normalize scores from a blast output
+    and write back blast results to *.norm.txt.gz
     """
     # Run Algorithm, cluster and output cluster files with original accessions
     util.PrintUnderline("Running OrthoFinder algorithm")
diff --git a/orthofinder/scripts/files.py b/orthofinder/scripts/files.py
index e7c7994..e527af0 100644
--- a/orthofinder/scripts/files.py
+++ b/orthofinder/scripts/files.py
@@ -589,7 +589,7 @@ class PreviousFilesLocator_new(PreviousFilesLocator):
         Get all relevant data from log file. 
         Checks the paths ssaved do exist still
         Should work with relevant paths to allow directory to move
-        Other methods can then check that the data required for a particualr run is available
+        Other methods can then check that the data required for a particular run is available
         """
         with open(logFN, 'r') as infile:
             for line in infile:
-- 
GitLab