Author: Nilesh Patra
Last-Update: 2020-09-21
Description: Fix name of phipack executable
Forwarded: not-needed

--- parsnp.orig/parsnp
+++ parsnp/parsnp
@@ -196,7 +196,7 @@
 def run_phipack(query,seqlen,workingdir):
     currdir = os.getcwd()
     os.chdir(workingdir)
-    command = "Profile -o -v -n %d -w 100 -m 100 -f %s > %s.out"%(seqlen,query,query)
+    command = "phipack-profile -o -v -n %d -w 100 -m 100 -f %s > %s.out"%(seqlen,query,query)
     run_command(command, 1)
     os.chdir(currdir)
 
@@ -695,7 +695,7 @@
         missing = True
         logger.critical("{} not in system path!".format(exe))
     if use_phipack:
-        exe = "Profile"
+        exe = "phipack-profile"
         if shutil.which(exe) is None:
             missing = True
             logger.critical("{} not in system path!".format(exe))
@@ -710,7 +710,7 @@
             logger.critical("No fasttree executable found in system path!".format(exe))
         missing = missing or (not has_fasttree)
     else:
-        exe = "raxmlHPC-PTHREADS"
+        exe = "raxmlHPC"
         if shutil.which(exe) is None:
             missing = True
             logger.critical("{} not in system path!".format(exe))
@@ -1039,7 +1039,7 @@
     '''
     # global extend, inifiled, file_string, cnt
     logger.debug("Writing .ini file")
-    inifiled = open("%s/template.ini" % (PARSNP_DIR), 'r').read()
+    inifiled = open("/usr/share/parsnp/template.ini", 'r').read()
     inifiled = inifiled.replace("$REF", ref)
     inifiled = inifiled.replace("$EXTEND", "%d" % (args.extend))
     inifiled = inifiled.replace("$ANCHORS", str(args.min_anchor_length))
@@ -1138,7 +1138,7 @@
     if not os.path.exists(inifile):
         logger.error("ini file %s does not exist!\n"%(inifile))
         sys.exit(1)
-    command = "%s/bin/parsnp_core %s"%(PARSNP_DIR,inifile)
+    command = "/usr/lib/parsnp/parsnp_core %s"%(inifile)
     # with open(f"{outputDir}/parsnpAligner.out", 'w') as stdout_f, open(f"{outputDir}/parsnpAligner.err", 'w') as stderr_f:
         # rc = run_command(command, ignorerc=1, stdout=stdout_f, stderr=stderr_f, prepend_time=True)
     rc = run_logged_command(command=command, ignorerc=1, label="parsnp-aligner", outputDir=outputDir)
@@ -1360,10 +1360,10 @@
         logger.info("Filtering genomes...")
         if use_parsnp_mumi:
             if not inifile_exists:
-                command = f"{PARSNP_DIR}/bin/parsnp_core {outputDir}/config/all_mumi.ini"
+                command = f"/usr/lib/parsnp/parsnp_core {outputDir}/config/all_mumi.ini"
             else:
                 # TODO why are we editing the suffix of a provided file?
-                command = f"{PARSNP_DIR}/bin/parsnp_core {inifile.replace('.ini', '_mumi.ini')}"
+                command = f"/usr/lib/parsnp/parsnp_core {inifile.replace('.ini', '_mumi.ini')}"
             run_logged_command(command=command, outputDir=outputDir, label="parsnp-mumi")
             # Takes eeach sequence and computes its mumi distance to the reference
             try:
@@ -1796,7 +1796,7 @@
                 break
         if not use_fasttree:
             with TemporaryDirectory() as raxml_output_dir:
-                command = "raxmlHPC-PTHREADS -m GTRCAT -p 12345 -T %d -s %s -w %s -n OUTPUT"%(threads,outputDir+os.sep+"parsnp.snps.mblocks", raxml_output_dir)
+                command = "raxmlHPC -m GTRCAT -p 12345 -T %d -s %s -w %s -n OUTPUT"%(threads,outputDir+os.sep+"parsnp.snps.mblocks", raxml_output_dir)
                 run_logged_command(command, outputDir=outputDir, label="raxml")
                 shutil.move(f"{raxml_output_dir}/RAxML_bestTree.OUTPUT", outputDir + os.sep + "parsnp.tree")
 
