Learn R Programming

⚠️There's a newer version (1.8.2) of this package.Take me there.

castor (version 1.6.1)

Efficient Phylogenetics on Large Trees

Description

Efficient phylogenetic analyses on massive phylogenies comprising up to millions of tips. Functions include pruning, rerooting, calculation of most-recent common ancestors, calculating distances from the tree root and calculating pairwise distances. Calculation of phylogenetic signal and mean trait depth (trait conservatism), ancestral state reconstruction and hidden character prediction of discrete characters, simulating and fitting models of trait evolution, fitting and simulating diversification models, dating trees, comparing trees, and reading/writing trees in Newick format. Citation: Louca, Stilianos and Doebeli, Michael (2017) .

Copy Link

Version

Install

install.packages('castor')

Monthly Downloads

1,671

Version

1.6.1

License

GPL (>= 2)

Maintainer

Stilianos Louca

Last Published

June 29th, 2020

Functions in castor (1.6.1)

castor-package

Efficient computations on large phylogenetic trees.
asr_subtree_averaging

Ancestral state reconstruction via subtree averaging.
asr_mk_model

Ancestral state reconstruction with Mk models and rerooting
asr_squared_change_parsimony

Squared-change parsimony ancestral state reconstruction.
congruent_divergence_times

Extract dating anchors for a target tree, using a dated reference tree
asr_max_parsimony

Maximum-parsimony ancestral state reconstruction.
asr_independent_contrasts

Ancestral state reconstruction via phylogenetic independent contrasts.
find_nearest_tips

Find nearest tip to each tip & node of a tree.
asr_empirical_probabilities

Empirical ancestral state probabilities.
count_tips_per_node

Count descending tips.
date_tree_red

Date a tree based on relative evolutionary divergences.
evaluate_spline

Evaluate a scalar spline at arbitrary locations.
collapse_monofurcations

Remove monofurcations from a tree.
collapse_tree_at_resolution

Collapse nodes of a tree at a phylogenetic resolution.
count_lineages_through_time

Count number of lineages through time (LTT).
extend_tree_to_height

Extend a rooted tree up to a specific height.
exponentiate_matrix

Exponentiate a matrix.
extract_fasttree_constraints

Extract tree constraints in FastTree alignment format.
fit_hbd_model_on_grid

Fit a homogenous birth-death model on a discrete time grid.
find_farthest_tips

Find farthest tip to each tip & node of a tree.
find_root

Find the root of a tree.
fit_bm_model

Fit a Brownian Motion model for multivariate trait evolution.
find_root_of_monophyletic_tips

Find the node or tip that, as root, would make a set of target tips monophyletic.
fit_hbd_pdr_parametric

Fit parameterized pulled diversification rates of birth-death models.
fit_hbd_pdr_on_grid

Fit pulled diversification rates of birth-death models on a time grid.
fit_hbd_model_parametric

Fit a parametric homogenous birth-death model to a timetree.
fit_hbd_psr_on_grid

Fit pulled speciation rates of birth-death models on a time grid.
fit_and_compare_bm_models

Fit and compare Brownian Motion models for multivariate trait evolution between two data sets.
generate_tree_hbd_reverse

Generate a tree from a birth-death model in reverse time.
get_pairwise_mrcas

Get most recent common ancestors of tip/node pairs.
get_all_pairwise_distances

Get distances between all pairs of tips and/or nodes.
get_clade_list

Get a representation of a tree as a table listing tips/nodes.
generate_random_tree

Generate a tree using a Poissonian speciation/extinction model.
fit_hbds_model_parametric

Fit a parametric homogenous birth-death-sampling model to a timetree.
root_at_midpoint

Root or re-root a tree at the midpoint node.
fit_musse

Fit a discrete-state-dependent diversification model via maximum-likelihood.
fit_mk

Fit a Markov (Mk) model for discrete trait evolution.
fit_sbm_linear

Fit a Spherical Brownian Motion model with linearly varying diffusivity on a tree.
hsp_binomial

Hidden state prediction for a binary trait based on the binomial distribution.
hsp_nearest_neighbor

Hidden state prediction based on nearest neighbor.
get_tree_traversal_root_to_tips

Traverse tree from root to tips.
fit_sbm_parametric

Fit a time-dependent Spherical Brownian Motion model on a tree.
hsp_squared_change_parsimony

Hidden state prediction via squared-change parsimony.
loglikelihood_hbd

Galculate the log-likelihood of a homogenous birth-death model.
geographic_acf

Phylogenetic autocorrelation function of geographic locations.
get_reds

Calculate relative evolutionary divergences in a tree.
simulate_tdsse

Simulate a time-dependent Discrete-State Speciation and Extinction (tdSSE) model.
reconstruct_past_diversification

Reconstruct past diversification dynamics from a diversity time series.
multifurcations_to_bifurcations

Expand multifurcations to bifurcations.
hsp_independent_contrasts

Hidden state prediction via phylogenetic independent contrasts.
simulate_sbm

Simulate Spherical Brownian Motion on a tree.
fit_sbm_const

Fit a Spherical Brownian Motion model on a tree.
get_random_mk_transition_matrix

Create a random transition matrix for an Mk model.
get_all_distances_to_root

Get distances of all tips and nodes to the root.
get_subtree_with_tips

Extract a subtree spanning a specific subset of tips.
generate_gene_tree_msc_hgt_dl

Generate gene trees based on the multi-species coalescent, horizontal gene transfers and duplications/losses.
generate_gene_tree_msc

Generate a gene tree based on the multi-species coalescent model.
root_at_node

Root or re-root a tree at a specific node.
get_tips_for_mrcas

Find tips with specific most recent common ancestors.
generate_tree_hbds

Generate a tree from a birth-death-sampling model in forward time.
get_independent_contrasts

Phylogenetic independent contrasts for continuous traits.
get_all_node_depths

Get the phylogenetic depth of each node in a tree.
get_subtree_at_node

Extract a subtree descending from a specific node.
map_to_state_space

Map states of a discrete trait to integers.
simulate_deterministic_hbds

Simulate a deterministic homogenous birth-death-sampling model.
get_stationary_distribution

Stationary distribution of Markov transition matrix.
root_in_edge

Root or re-root a tree in the middle of an edge.
simulate_deterministic_hbd

Simulate a deterministic homogenous birth-death model.
hsp_empirical_probabilities

Hidden state prediction via empirical probabilities.
get_trait_acf

Phylogenetic autocorrelation function of a numeric trait.
simulate_dsse

Simulate a Discrete-State Speciation and Extinction (dSSE) model.
simulate_bm_model

Simulate a Brownian motion model for multivariate trait co-evolution.
read_tree

Load a tree from a string or file in Newick (parenthetic) format.
get_transition_index_matrix

Create an index matrix for a Markov transition model.
generate_tree_with_evolving_rates

Generate a random tree with evolving speciation/extinction rates.
get_tree_span

Get min and max distance of any tip to the root.
split_tree_at_height

Split a tree into subtrees at a specific height.
simulate_diversification_model

Simulate a deterministic uniform speciation/extinction model.
simulate_mk_model

Simulate an Mk model for discrete trait evolution.
write_tree

Write a tree in Newick (parenthetic) format.
hsp_subtree_averaging

Hidden state prediction via subtree averaging.
is_monophyletic

Determine if a set of tips is monophyletic.
fit_tree_model

Fit a cladogenic model to an existing tree.
simulate_rou_model

Simulate a reflected Ornstein-Uhlenbeck model for continuous trait evolution.
hsp_max_parsimony

Hidden state prediction via maximum parsimony.
get_random_diffusivity_matrix

Create a random diffusivity matrix for a Brownian motion model.
hsp_mk_model

Hidden state prediction with Mk models and rerooting
merge_short_edges

Eliminate short edges in a tree by merging nodes into multifurcations.
gamma_statistic

Calculate the gamma-statistic of a tree.
get_pairwise_distances

Get distances between pairs of tips or nodes.
reorder_tree_edges

Reorder tree edges in preorder or postorder.
simulate_ou_model

Simulate an Ornstein-Uhlenbeck model for continuous trait evolution.
get_mrca_of_set

Most recent common ancestor of a set of tips/nodes.
get_subtrees_at_nodes

Extract subtrees descending from specific nodes.
tree_from_branching_ages

Generate a random timetree with specific branching ages.
pick_random_tips

Pick random subsets of tips on a tree.
get_trait_stats_over_time

Calculate mean & standard deviation of a numeric trait on a dated tree over time.
get_trait_depth

Calculate depth of phylogenetic conservatism for a binary trait.
root_via_outgroup

Root or re-root a tree based on an outgroup tip.
trim_tree_at_height

Trim a rooted tree down to a specific height.
tree_distance

Calculate the distance between two trees.