Skip to content

add new as.phylo method for chronos class#54

Closed
xiangpin wants to merge 1 commit intoYuLab-SMU:masterfrom
xiangpin:dev
Closed

add new as.phylo method for chronos class#54
xiangpin wants to merge 1 commit intoYuLab-SMU:masterfrom
xiangpin:dev

Conversation

@xiangpin
Copy link
Member

@xiangpin xiangpin commented May 1, 2021

Description

when the phylo tree was processed, the new class c("chronos", "phylo") will return. Although ggtree provided fortify.phylo can process it, but as.phylo in the internal of this function cannot process this object.

Related Issue

https://groups.google.com/g/bioc-ggtree/c/9h3f8D3nlVs/m/0pBbzIoVAwAJ

Error in UseMethod("as.phylo") :
  no applicable method for 'as.phylo' applied to an object of class "c('chronos', 'phylo')"

Example

> library(ape)
> library(treeio)
treeio v1.15.7  For help: https://yulab-smu.top/treedata-book/

If you use treeio in published research, please cite:

LG Wang, TTY Lam, S Xu, Z Dai, L Zhou, T Feng, P Guo, CW Dunn, BR Jones, T Bradley, H Zhu, Y Guan, Y Jiang, G Yu. treeio: an R package for phylogenetic tree input and output with richly annotated and associated data. Molecular Biology and Evolution 2020, 37(2):599-603. doi: 10.1093/molbev/msz240

> set.seed(123)
> tr <- rtree(10)
> chr <- chronos(tr)

Setting initial dates...
Fitting in progress... get a first set of estimates
         (Penalised) log-lik = -14.9003 
Optimising rates... dates... -14.9003 

log-Lik = -14.75905 
PHIIC = 81.7 
> class(chr)
[1] "chronos" "phylo"  
> library(ggtree)
ggtree v2.4.2  For help: https://yulab-smu.top/treedata-book/

If you use ggtree in published research, please cite the most appropriate paper(s):

1. Guangchuang Yu. Using ggtree to visualize data on tree-like structures. Current Protocols in Bioinformatics, 2020, 69:e96. doi:10.1002/cpbi.96
2. Guangchuang Yu, Tommy Tsan-Yuk Lam, Huachen Zhu, Yi Guan. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution 2018, 35(12):3041-3043. doi:10.1093/molbev/msy194
3. Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2017, 8(1):28-36. doi:10.1111/2041-210X.12628


> ggtree(chr)

屏幕快照 2021-05-01 23 33 15

@GuangchuangYu
Copy link
Member

should be fixed in ape, see emmanuelparadis/ape#10.

@GuangchuangYu
Copy link
Member

fixed in emmanuelparadis/ape@b362e42

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.

2 participants