Entering edit mode
7.3 years ago
russianconcussion
▴
30
Hi,
When I try to run the FastTree wrapper from Bio.Phylo.Applications, it fails, giving me this message:
ApplicationError: Non-zero return code 1 from '/home/fetz/genome/phylosift_v1.0.1/bin/FastTree -nt -gtr -out 245_hypothetical_protein.tre 245_hypothetical_protein.codon', message 'Unknown or incorrect use of option -out'
My Biopython version is 1.68:
import Bio
Bio.__version__
'1.68'
My code, run in ipython3, is:
from Bio.Phylo.Applications import _Fasttree
fasttree_exe = r"/home/fetz/genome/phylosift_v1.0.1/bin/FastTree"
codonfile = "245_hypothetical_protein.codon"
outfile = codonfile.replace(".codon",".tre")
cmd = _Fasttree.FastTreeCommandline(fasttree_exe, nt = True, gtr = True, input = codonfile, out = outfile)
cmd()
The input file, 'codonfile,' is a verified codon alignment from the Bio.codonalign module that has been written to a file. I cannot find any errors in my command construction according to the example given in the API. Can anyone suggest what I am doing wrong? Thank you in advance.
Taken from FastTree docs:
and
It seems that both options
nt
andgtr
are for nucleotide alignments and your file is a codon alignment.Try
cmd = _Fasttree.FastTreeCommandline(fasttree_exe, input = codonfile, out = outfile)
to see if it works.[EDIT] This is is based only on the assumption that your codon alignment is not a nucleotide alignment file.
Hi Rodrigo. Actually, my codon alignment is in nucleotides, not amino acids. In a codon alignment, you use a protein alignment to constrain the cognate nucleotide alignment. So I'm sure that the -gtr and -nt options are fine. Here is the head of the codon alignment file:
I think it might be a bug in the Biopython wrapper, since the FastTree (version 2.1.3 SSE3) options don't include an "out" option.
Ok I see thanks for the info. It actually has an option
-out
:Where tree protein is your
.tree.
file and the protein_alignment your.fasta
(in your case a.codon
file). Have you tried runningFastTree -gtr -n -out 245_hypothetical_protein.codon 245_hypothetical_protein.tree
?Hmmm. It definitely doesn't have an '-out' option in my version of FastTree (2.1.3 SSE3). For example, if I try:
Works fine and yields a tree in stdout:
However, if I add the '-out' option to the same command:
I get no tree and a lecture on how to use FastTree:
I think it might be down to my version of FastTree or a bug in the wrapper.
The
-out
version is available for the version2.1.10
so maybe is a matter of updating your FastTree version. Also the correct way would be to type in the command lineFastTree -nt -gtr -out test.out test.codon
.Oops! Yes, you're right; I wrote the command wrong. Regardless, after updating to FastTree 2.1.10, the Biopython wrapper works! It was my ancient version of FastTree that was causing me trouble. Thank you for your help, Rodrigo!
I know this is an old post, but do you happen to know if it is possible for input to take a file handle rather than a filename?