Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a path in the output prefix results in false message that there is no tree file #5

Open
ak-watson opened this issue Jul 6, 2021 · 0 comments

Comments

@ak-watson
Copy link

ak-watson commented Jul 6, 2021

When I run FlaGs with tree mode, I receive the message.

'> ETE3 failed to create tree due to lack of valid protein accesions, at least 2 required !'

ETE3 actually succeeded in creating the tree, but the problem is with my output prefix.

I normally used a path in my output prefix to send data to an output directory to organise my data (say if I am using Flags on multiple different gene lists in the same set of genomes).

So my output prefix is something like "outputdir/output_prefix"

Unfortunately this doesn't play nicely with the following test for whether a tree has been sucessfully built by ete3:

if os.path.isfile(args.out_prefix+'_tree/mafft_default-trimal01-none-fasttree_full/'+args.out_prefix+'_tree.fasta.final_tree.nw') == True:

This would mean looking for the treefile in "outputdir/output_prefix_tree/mafft_default-trimal01-none-fasttree_full/outputdir/output_predix_tree.fasta.final_tree.nw'

It might be useful to either have a separate option to allow a user-specified output directory.

Or otherwise, as a quick fix for my own use I have swapped out os.path.isfile for glob.glob which allows wildcards and prevents the need to add a second args.out_prefix argument.

if glob.glob(args.out_prefix+'_tree/mafft_default-trimal01-none-fasttree_full/*fasta.final_tree.nw'): with open(glob.glob(args.out_prefix+'_tree/mafft_default-trimal01-none-fasttree_full/*fasta.final_tree.nw')[0], 'r') as treeIn:
Thanks!
Andrew

@ak-watson ak-watson changed the title Using a path in the output prefix results in a Using a path in the output prefix results in false message that there is no tree file Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant