compmetagen / micca

micca - MICrobial Community Analysis
http://compmetagen.github.io/micca
GNU General Public License v3.0
20 stars 9 forks source link

micca tree :: FastTree error #17

Open EricDeveaud opened 5 years ago

EricDeveaud commented 5 years ago

Hello while testing micca I encounter the following problem.

see:

/tmp/micca2/bin/micca tree -i ~tests/datas/micca/sample_data -o tree.tree  --fasttree-gtr
Error:   FastTree protein_alignment > tree
  FastTree < protein_alignment > tree
  FastTree -out tree protein_alignment
  FastTree -nt nucleotide_alignment > tree
  FastTree -nt -gtr < nucleotide_alignment > tree
  FastTree < nucleotide_alignment > tree
FastTree accepts alignments in fasta or phylip interleaved formats

while looking at tp/_fasttree.py, noticed that when FastTree specific options is provided via
--fasttree-gtr or --fasttree-fastest, the relevant option for FatsTree is APPENDED to the command line. thus generate something like that

fasttree -nt alignementfile -gtr

but fasttree is pretty picky with the order of options // argument. -gtr or -fastest option must precede inputfile should be something like that

fasttree -nt -gtr alignementfile
 fasttree -gtr -nt alignementfile

changing tp/_fasttree.py from

    params = ["-nt", input_fn]
    if gtr:
        params.append("-gtr")
    if fastest:
        params.append("-fastest")

to

    params = ["-nt", input_fn]
    if gtr:
        params.insert(0, "-gtr")
    if fastest:
        params.insert(0, "-fastest")

solved the problem

regards

Eric