Skip to content

Commit

Permalink
Merge pull request #711 from nextstrain/iqtree-find-executable
Browse files Browse the repository at this point in the history
augur tree: Adds call to `find_executable` for `build_iqtree` function
  • Loading branch information
huddlej authored Apr 7, 2021
2 parents 24baeaf + 31ad8fc commit 1815565
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions augur/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def build_iqtree(aln_file, out_file, substitution_model="GTR", clean_up=True, nt
aln_file file name of input aligment
out_file file name to write tree to
'''
iqtree = find_executable([
"iqtree2",
"iqtree"
])
# create a dictionary for characters that IQ-tree changes.
# we remove those prior to tree-building and reinstantiate later
def random_string(n):
Expand Down Expand Up @@ -188,10 +192,10 @@ def random_string(n):
)

if substitution_model.lower() != "none":
call = ["iqtree", *fast_opts, "-nt", str(nthreads), "-s", shquote(tmp_aln_file),
call = [iqtree, *fast_opts, "-nt", str(nthreads), "-s", shquote(tmp_aln_file),
"-m", substitution_model, tree_builder_args, ">", log_file]
else:
call = ["iqtree", *fast_opts, "-nt", str(nthreads), "-s", shquote(tmp_aln_file), tree_builder_args, ">", shquote(log_file)]
call = [iqtree *fast_opts, "-nt", str(nthreads), "-s", shquote(tmp_aln_file), tree_builder_args, ">", shquote(log_file)]

cmd = " ".join(call)

Expand Down

0 comments on commit 1815565

Please sign in to comment.