Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization read.mcmctree #60

Merged
merged 7 commits into from
Jun 9, 2021

Conversation

xiangpin
Copy link
Member

@xiangpin xiangpin commented Jun 8, 2021

Description

as mention in issue #13 , The branching time can be calculated via branching.times of ape. But it is should be under the assumption that the tree is ultrametric.
But how to convert it to ultrametric if the tree is not ultrametric. This blog shared some methods. In the request, I used extend method. I think other methods should be discussed.

Related Issue

Example

library(treeio)
library(ggtree)
file <- system.file("extdata/MCMCTree", "mcmctree_output.tree", package="treeio")
tr <- read.mcmctree(file)
tr
p <- ggtree(tr)
p + geom_range(range="`0.95`", center="reltime", alpha=0.6, color="blue", size=2)

捕获

R/MCMCTree.R Outdated
flag_ultrametric <- is.ultrametric(obj@phylo, option=2) || is.ultrametric(obj@phylo)
if (force.ultrametric && flag_ultrametric){
message("This tree is not ultrametric, and you has set force.ultrametric to TRUE, so the tree will be converted to ultrametric automatically!")
obj <- force.ultrametric(obj)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot find the force.ultrametric function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, It should be as.ultrametric

@GuangchuangYu GuangchuangYu merged commit 8ab7c42 into YuLab-SMU:master Jun 9, 2021
@Tiramisu023
Copy link

Tiramisu023 commented Jun 15, 2021

Thank you, this read.mcmctree() function solved my problem perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants