From d614c02dfb36a22ab3e0474bb35684f557d5da34 Mon Sep 17 00:00:00 2001 From: fasnicar Date: Tue, 8 Sep 2020 17:29:06 +0200 Subject: [PATCH] fixing tree1 when iqtree --- phylophlan/phylophlan.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/phylophlan/phylophlan.py b/phylophlan/phylophlan.py index cfad79f..62f035d 100755 --- a/phylophlan/phylophlan.py +++ b/phylophlan/phylophlan.py @@ -6,7 +6,7 @@ 'Claudia Mengoni (claudia.mengoni@studenti.unitn.it), ' 'Mattia Bolzan (mattia.bolzan@unitn.it), ' 'Nicola Segata (nicola.segata@unitn.it)') -__version__ = '3.0.57' +__version__ = '3.0.58' __date__ = '8 September 2020' @@ -3027,11 +3027,17 @@ def standard_phylogeny_reconstruction(project_name, configs, args, db_dna, db_aa if 'tree2' in configs: outt = project_name + '_resolved.tre' - resolve_polytomies(os.path.join(args.output, out_f), os.path.join(args.output, outt), nproc=args.nproc, verbose=args.verbose) - out_f = os.path.join(args.output, outt) + inp_tree = os.path.join(args.output, out_f) # FastTree output phylogeny - refine_phylogeny(configs, 'tree2', inp_f, out_f, os.path.abspath(args.output), project_name + '_refined.tre', - nproc=args.nproc, verbose=args.verbose) + if not os.path.isfile(inp_tree): + inp_tree += '.treefile' # IQ-TREE output phylogeny + + if not os.path.isfile(inp_tree): + error('output phylogeny from [tree1] not recognized', exit=True) + + resolve_polytomies(inp_tree, os.path.join(args.output, outt), nproc=args.nproc, verbose=args.verbose) + refine_phylogeny(configs, 'tree2', inp_f, os.path.join(args.output, outt), os.path.abspath(args.output), + project_name + '_refined.tre', nproc=args.nproc, verbose=args.verbose) def byte_to_megabyte(byte):