ape icon indicating copy to clipboard operation
ape copied to clipboard

phymltest() producing the double amount of trees

Open mickvv opened this issue 1 year ago • 6 comments

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

mickvv avatar Nov 22 '23 15:11 mickvv

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

Cheers, Emmanuel

emmanuelparadis avatar Nov 23 '23 02:11 emmanuelparadis

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

mickvv avatar Nov 23 '23 08:11 mickvv

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 avatar Nov 23 '23 10:11 emmanuelparadis

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

3:3.3.20211231-1

emmanuelparadis avatar Nov 23 '23 10:11 emmanuelparadis

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

Regards, Mick

mickvv avatar Nov 23 '23 15:11 mickvv

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-

stephaneguindon avatar Nov 23 '23 15:11 stephaneguindon