emmanuelparadis / ape

analysis of phylogenetics and evolution
http://ape-package.ird.fr/
GNU General Public License v2.0
52 stars 11 forks source link

phymltest() producing the double amount of trees #105

Open mickvv opened 9 months ago

mickvv commented 9 months ago

When running phymltest() with the 28 models, the produced treefile _phyml_tree.txt contains 56 trees instead of expected 28.

Is it normal ?

Thanks Mick

emmanuelparadis commented 9 months ago

Maybe you called phymltest() twice? See ?unique.multiPhylo to try to check this.

Cheers, Emmanuel

mickvv commented 9 months ago

Thank you for your quick answer.

I run this command: phyml.sylvia <- phymltest("sylvia.phy", execname="/usr/bin/phyml") I've tried removing the _phyml_tree.txt output to avoid appending to the same file. Thanks for the ?unique.multiPhylo, it is a useful command but in my case I go from 56 to 11 trees. I also looked at the _phyml_stats.txt and there are indeed 28 runs listed. It seems that for each model tested, 2 trees are produced but I don't know which one to choose out of the 56... My goal is to get the tree for the best model.

Cheers, Mick

emmanuelparadis commented 9 months ago

It seems like a bug in phyml. Using sequence data from here, the (shell) command:

phyml -i sylvia.txt

runs fine and creates the file 'sylvia.txt_phyml_tree.txt' with a single tree. Then if I run:

phyml -i sylvia.txt --append

the file has 3 trees (or 2 if I delete the output files beforehand).

I'm adding @stephaneguindon to this thread.

This is under Ubuntu (for me).

@mickvv Since each tree is duplicated, you should be able to get one tree out of two with:

TR <- read.tree("sylvia.phy_phyml_tree.txt") # using changed file extension
TR[c(TRUE, FALSE)]

Also, the next one should give you the same 28 trees:

unique.multiPhylo(TR, use.edge.length = TRUE)

Cheers, Emmanuel

emmanuelparadis commented 9 months ago

Just checked my version number of phyml (under Ubuntu 22):

3:3.3.20211231-1

mickvv commented 9 months ago

Thank you very much, I think it will do the trick !

Regards, Mick

stephaneguindon commented 9 months ago

It seems like a bug in phyml. Using sequence data from here, the (shell) command:

phyml -i sylvia.txt

runs fine and creates the file 'sylvia.txt_phyml_tree.txt' with a single tree. Then if I run:

phyml -i sylvia.txt --append

the file has 3 trees (or 2 if I delete the output files beforehand).

I'm adding @stephaneguindon to this thread.

This is under Ubuntu (for me).

@mickvv Since each tree is duplicated, you should be able to get one tree out of two with:

TR <- read.tree("sylvia.phy_phyml_tree.txt") # using changed file extension
TR[c(TRUE, FALSE)]

Also, the next one should give you the same 28 trees:

unique.multiPhylo(TR, use.edge.length = TRUE)

Cheers, Emmanuel

Thanks. I will take a look at this issue. Regards, -Stephane-