Export otu_tree or taxa_tree from a microbiome_dataset in the desired
representation.
Examples
data("global_patterns", package = "microbiomedataset")
x <- prune_taxa(global_patterns, variable_id = global_patterns@variable_info$variable_id[1:120])
x <- microbiomedataset::convert2microbiome_dataset(
microbiomedataset::convert2phyloseq(x)
)
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
tree_tbl <- extract_tree_data(x, tree = "taxa_tree", data_type = "table")
head(tree_tbl)
#> parent node label nodeClass nodeDepth
#> 1 182 1 72 variable_id 8
#> 2 182 2 73 variable_id 8
#> 3 182 3 74 variable_id 8
#> 4 182 4 75 variable_id 8
#> 5 182 5 76 variable_id 8
#> 6 182 6 77 variable_id 8
