xavierdidelot / BactDating

Bayesian inference of ancestral dates on bacterial phylogenetic trees
https://xavierdidelot.github.io/BactDating
MIT License
80 stars 15 forks source link

Is it possibile for providing the outgroup taxa to root the tree? #56

Closed Tonny-zhou closed 2 years ago

Tonny-zhou commented 2 years ago

Dear author,

Thank you for this great dating tool! I have a small question, i.e., is it possibile for user to specify the name of the outgroup within the input unrooted tree? I know the input tree for main function bactdate is a unrooted tree, so I guess whether supplying the outgroup could help to detect the best root position?

Yours, Tonny

xavierdidelot commented 2 years ago

If you have an outgroup in your tree you could first use it to root the tree (using ape::root) then remove the outgroup (using ape::drop.tip) and then run the BactDating analysis on the remaining tree with root known (using bactdate(...,updateRoot=F)

Tonny-zhou commented 2 years ago

If you have an outgroup in your tree you could first use it to root the tree (using ape::root) then remove the outgroup (using ape::drop.tip) and then run the BactDating analysis on the remaining tree with root known (using bactdate(...,updateRoot=F) Dear author,

I followed the above actions, however, the results of roottotip function seemed wrong, as the warning message said "The linear regression suggests a negative rate". However, if i used the result of initRoot function as the input tree for roottotip function, the results seemed reasonable. So, does it mean the outgroup within my tree is not suitable? but i used the outgroup from the publication reference. I really hope you could solve my doubts.

Yours, Tonny

xavierdidelot commented 2 years ago

Yes, it seems that the outgroup is giving a false impression for the location of the root in this case, which can happen especially if the outgroup is very distantly related.