diff --git a/Tests/test_orthofinder.py b/Tests/test_orthofinder.py index 8aa8d2d8..1c602806 100755 --- a/Tests/test_orthofinder.py +++ b/Tests/test_orthofinder.py @@ -34,7 +34,7 @@ goldResultsDir_smallExample = baseDir + "ExpectedOutput/SmallExampleDataset/" goldPrepareBlastDir = baseDir + "ExpectedOutput/SmallExampleDataset_PreparedForBlast/" -version = "1.0.7" +version = "1.0.8" requiredBlastVersion = "2.2.28+" citation = """When publishing work that uses OrthoFinder please cite: diff --git a/orthofinder/orthofinder.py b/orthofinder/orthofinder.py index 7bbc206f..ce7441de 100755 --- a/orthofinder/orthofinder.py +++ b/orthofinder/orthofinder.py @@ -55,9 +55,13 @@ with open(os.devnull, "w") as f: subprocess.call("taskset -p 0xffffffffffff %d" % os.getpid(), shell=True, stdout=f) # get round problem with python multiprocessing library that can set all cpu affinities to a single cpu - +my_env = os.environ.copy() +if getattr(sys, 'frozen', False): +# my_env['LD_LIBRARY_PATH'] = my_env['LD_LIBRARY_PATH_ORIG'] + my_env['LD_LIBRARY_PATH'] = '' + def RunBlastDBCommand(command): - capture = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + capture = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env) stdout = [x for x in capture.stdout] stderr = [x for x in capture.stderr] nLines_success= 10 diff --git a/orthofinder/scripts/get_orthologues.py b/orthofinder/scripts/get_orthologues.py index ce4c5770..3fca659c 100755 --- a/orthofinder/scripts/get_orthologues.py +++ b/orthofinder/scripts/get_orthologues.py @@ -48,6 +48,10 @@ import blast_file_processor as BlastFileProcessor nThreads = util.nThreadsDefault +my_env = os.environ.copy() +if getattr(sys, 'frozen', False): +# my_env['LD_LIBRARY_PATH'] = my_env['LD_LIBRARY_PATH_ORIG'] + my_env['LD_LIBRARY_PATH'] = '' class Seq(object): def __init__(self, seqInput): @@ -208,7 +212,7 @@ def RunAstral(ogSet, treesPat, workingDir): treesFN = dir_astral + "TreesFile.txt" ConcatenateTrees(i_ogs_to_use, treesPat, treesFN) speciesTreeFN = workingDir + "SpeciesTree_astral.txt" - subprocess.call(" ".join(["java", "-Xmx6000M", "-jar", "~/software/ASTRAL-multiind/Astral/astral.4.8.0.jar", "-a", tmFN, "-i", treesFN, "-o", speciesTreeFN]), shell=True) + subprocess.call(" ".join(["java", "-Xmx6000M", "-jar", "~/software/ASTRAL-multiind/Astral/astral.4.8.0.jar", "-a", tmFN, "-i", treesFN, "-o", speciesTreeFN]), shell=True, env=my_env) return speciesTreeFN # ============================================================================================================================== @@ -455,7 +459,7 @@ def RunDlcpar(treesPat, ogSet, nOGs, speciesTreeFN, workingDir): filenames = [dlcparResultsDir + os.path.split(treesPat % i)[1] for i in xrange(nOGs)] - dlcCommands = ['dlcpar_search -s %s -S %s -D 1 -C 0.125 %s -I .txt' % (speciesTreeFN, geneMapFN, fn) for fn in filenames] + dlcCommands = ['dlcpar_search -s %s -S %s -D 1 -C 0.125 %s -I .txt -x 1' % (speciesTreeFN, geneMapFN, fn) for fn in filenames] # print(dlcCommands[0]) # use this to run in parallel util.RunParallelOrderedCommandLists(nThreads, [[c] for c in dlcCommands], qHideStdout = True) diff --git a/orthofinder/scripts/util.py b/orthofinder/scripts/util.py index ce7118ae..b9d3c1f8 100644 --- a/orthofinder/scripts/util.py +++ b/orthofinder/scripts/util.py @@ -47,7 +47,12 @@ FileInfo = namedtuple("FileInfo", "inputDir outputDir graphFilename") picProtocol = 1 -version = "1.0.7" +version = "1.0.8" + +my_env = os.environ.copy() +if getattr(sys, 'frozen', False): +# my_env['LD_LIBRARY_PATH'] = my_env['LD_LIBRARY_PATH_ORIG'] + my_env['LD_LIBRARY_PATH'] = "" def PrintNoNewLine(text): sys.stdout.write(text) @@ -61,19 +66,19 @@ def PrintTime(message): """ def RunCommand(command): - subprocess.call(command) + subprocess.call(command, env=my_env) def RunOrderedCommandList(commandSet, qHideStdout): if qHideStdout: for cmd in commandSet: - subprocess.call(cmd, shell=True, stdout=subprocess.PIPE) + subprocess.call(cmd, shell=True, stdout=subprocess.PIPE, env=my_env) else: for cmd in commandSet: - subprocess.call(cmd, shell=True) + subprocess.call(cmd, shell=True, env=my_env) def CanRunCommand(command, qAllowStderr = False): PrintNoNewLine("Test can run \"%s\"" % command) # print without newline - capture = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + capture = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env) stdout = [x for x in capture.stdout] stderr = [x for x in capture.stderr] if len(stdout) > 0 and (qAllowStderr or len(stderr) == 0): @@ -90,7 +95,7 @@ def Worker_RunCommand(cmd_queue, nProcesses, nToDo): nDone = i - nProcesses + 1 if nDone >= 0 and divmod(nDone, 10 if nToDo <= 200 else 100 if nToDo <= 2000 else 1000)[1] == 0: PrintTime("Done %d of %d" % (nDone, nToDo)) - subprocess.call(command) + subprocess.call(command, env=my_env) except Queue.Empty: return