tax2tree
tax2tree(
x,
ranks = c("kingdom", "phylum", "class", "order", "family", "genus", "species"),
depth = NULL,
summarise = FALSE,
output = "phylo",
replace_bads = FALSE,
append_sum = TRUE
)
a DNAbin object or an object coercible to DNAbin
The taxonomic ranks currently assigned to the names
The depth within the tree to return. Default NULL to return lowest input rank
Select a taxonomic rank to summarise below. Default is FALSE to return a tree of the same size as input
The output to return, options are: "phylo" to return an ape phylo object. If summarise is set to a rank, the number of distinct taxa at that rank numbers are appended to the tip labels if append_sum is TRUE, or returned as an attribute and can be accessed with attr(tree, "sum") "data.tree" to return a data.tree node object "treedf" to return a simplified tree with taxon summaries in a data frame "newick" to return a newick file for visualisation in other software. If summarise is set to a rank, the number of distinct taxa at that rank numbers are returned as an attribute and can be accessed with attr(tree, "sum")
An option to automatically replace invalid newick characters with '-'
An option to append the summary number to the output trees tip labels when summarise is a rank and output is 'phylo'. If FALSE, summary numbers are returned as an attribute and can be accessed with attr(tree, "sum")
a phylo, data.tree, newick, or treedf object