YuLab-SMU / treeio

:seedling: Base Classes and Functions for Phylogenetic Tree Input and Output
https://yulab-smu.top/treedata-book/
94 stars 24 forks source link

add read.nextstrain.json #81

Closed xiangpin closed 2 years ago

xiangpin commented 2 years ago

Description

add read.nextstrain.json function to parse the json tree file of NextStrain. the result return a treedata class.

Related Issue

Example

library(ggtree)
library(treeio)
file1 <- system.file("extdata/nextstrain.json", "minimal_v2.json", package="treeio")
tr <- read.nextstrain.json(file1)
tr %>% ggtree() + geom_tiplab() + geom_tippoint(aes(color=country)) + xlim_tree(x=.009)

xx