Skip to content

Commit 0a0a81d

Browse files
committed
Add support for bash process substitution
1 parent af983b3 commit 0a0a81d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

attotree/attotree.py

+8
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ def attotree(fns, newick_fo, k, s, t, phylogeny_algorithm, fof):
273273
phylip2_fn = os.path.join(d, "distances.phylip")
274274
newick1_fn = os.path.join(d, "tree.nw")
275275
newick2_fo = newick_fo
276+
if fof:
277+
#This is to make the list of file pass to Mash even with
278+
#process substitutions
279+
old_fof_fn = fns[0]
280+
new_fof_fn = os.path.join(d, "fof.txt")
281+
with open(old_fof_fn) as f, open(new_fof_fn, 'w') as g:
282+
g.write(f.read())
283+
fns = [new_fof_fn]
276284
mash_triangle(fns, phylip1_fn, k=k, s=s, t=t, fof=fof)
277285
postprocess_mash_phylip(phylip1_fn, phylip2_fn)
278286
quicktree(phylip2_fn, newick1_fn, algorithm=phylogeny_algorithm)

0 commit comments

Comments
 (0)