Prepare a phylogenetic tree — prepare_tree (original) (raw)
Import a phylogenetic tree and then conduct a series of optional standardisation steps. Optionally, if output_format
is not NULL
, species names from both the tree and the species
argument will first be standardised using map_species.
prepare_tree(
tree_source = "timetree",
species = NULL,
output_format = "scientific_name_formatted",
run_map_species = c(TRUE, TRUE),
method = c("homologene", "gprofiler", "babelgene"),
force_ultrametric = TRUE,
age_max = NULL,
show_plot = TRUE,
save_dir = tools::R_user_dir("orthogene", which = "cache"),
verbose = TRUE,
...
)
Arguments
Can be one of the following:
- "timetree2022":
Import and prune theTimeTree >147k species phylogenetic tree. Can also simply type "timetree". - "timetree2015":
Import and prune theTimeTree >50k species phylogenetic tree. - "OmaDB":
Construct a tree from OMA(Orthologous Matrix browser) via the getTaxonomy function.NOTE: Does not contain branch lengths, and therefore may have limited utility. - "UCSC":
Import and prune theUCSC 100-way alignment phylogenetic tree (hg38 version). - "
":
Read a tree from a newick text file from a local or remote URL using read.tree.
Species names to subset the tree by (after standardise_species
step).
Which column to return.
Whether to first standardise species names withmap_species.
R package to use for gene mapping:
"gprofiler"
: Slower but more species and genes."homologene"
: Faster but fewer species and genes."babelgene"
: Faster but fewer species and genes. Also gives consensus scores for each gene mapping based on a several different data sources.
Whether to force the tree to be ultrametric (i.e. make all tips the same date) using force.ultrametric.
Rescale the edges of the tree into units of millions of years (MY) instead than evolutionary rates (e.g. dN/dS ratios). Only used if age_max
, the max number , is numeric. Times are computed usingmakeChronosCalib and chronos.
Show a basic plot of the resulting tree.
Directory to cache full tree in. Set to NULL
to avoid using cache.
Print messages.
Additional arguments passed to makeChronosCalib.
Value
A filtered tree of class "phylo" (with standardised species names).
Examples
if(require("ape")){
species <- c("human","chimp","mouse")
tr <- orthogene::prepare_tree(species = species)
}
#> Importing tree from: TimeTree2022
#> Importing cached tree.
#> Standardising tip labels.
#> Mapping 3 species from `species`.
#> Mapping 3 species from tree.
#> --
#> 0/3 (0%) tips dropped from tree due to inability to standardise names with `map_species`.
#> --
#> 0/3 (0%) tips dropped from tree according to overlap with selected `species`.