Learn R Programming

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

castor (version 1.3.6)

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,735

Version

1.3.6

License

GPL (>= 2)

Maintainer

Stilianos Louca

Last Published

May 6th, 2019

Functions in castor (1.3.6)

asr_empirical_probabilities

Empirical ancestral state probabilities.
asr_independent_contrasts

Ancestral state reconstruction via phylogenetic independent contrasts.
find_nearest_tips

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

Find the root of a tree.
get_independent_contrasts

Phylogenetic independent contrasts for continuous traits.
find_root_of_monophyletic_tips

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

Maximum-parsimony ancestral state reconstruction.
fit_bm_model

Fit a Brownian motion model for multivariate trait evolution.
get_mrca_of_set

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

Calculate relative evolutionary divergences in a tree.
collapse_tree_at_resolution

Collapse nodes of a tree at a phylogenetic resolution.
get_stationary_distribution

Stationary distribution of Markov transition matrix.
asr_mk_model

Ancestral state reconstruction with Mk models and rerooting
congruent_divergence_times

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

Ancestral state reconstruction via subtree averaging.
castor-package

Efficient computations on large phylogenetic trees.
count_clades_over_time

Count number of clades over time.
extend_tree_to_height

Extend a rooted tree up to a specific height.
count_tips_per_node

Count descending tips.
collapse_monofurcations

Remove monofurcations from a tree.
find_farthest_tips

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

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

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

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

Hidden state prediction via subtree averaging.
get_all_node_depths

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

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

Create a random transition matrix for an Mk model.
get_pairwise_distances

Get distances between pairs of tips or nodes.
hsp_independent_contrasts

Hidden state prediction via phylogenetic independent contrasts.
get_pairwise_mrcas

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

Hidden state prediction via maximum parsimony.
root_via_outgroup

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

Calculate depth of phylogenetic conservatism for a binary trait.
is_monophyletic

Determine if a set of tips is monophyletic.
get_trait_stats_over_time

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

Map states of a discrete trait to integers.
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.
simulate_bm_model

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

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

Hidden state prediction via squared-change parsimony.
tree_distance

Calculate the distance between two trees.
root_at_node

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

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

Date a tree based on relative evolutionary divergences.
fit_tree_model

Fit a cladogenic model to an existing tree.
exponentiate_matrix

Exponentiate a matrix.
root_in_edge

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

Create an index matrix for a Markov transition model.
get_tree_span

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

Reorder tree edges in preorder or postorder.
trim_tree_at_height

Trim a rooted tree down to a specific height.
write_tree

Write a tree in Newick (parenthetic) format.
get_subtree_at_node

Extract a subtree descending from a specific node.
root_at_midpoint

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

Extract a subtree spanning a specific subset of tips.
simulate_diversification_model

Simulate a deterministic uniform speciation/extinction model.
simulate_mk_model

Simulate an Mk model for discrete trait evolution.
get_tips_for_mrcas

Find tips with specific most recent common ancestors.
get_trait_acf

Phylogenetic autocorrelation function of a numeric trait.
get_tree_traversal_root_to_tips

Traverse tree from root to tips.
hsp_empirical_probabilities

Hidden state prediction via empirical probabilities.
read_tree

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

Expand multifurcations to bifurcations.
pick_random_tips

Pick random subsets of tips on a tree.
reconstruct_past_diversification

Reconstruct past diversification dynamics from a diversity time series.
simulate_musse

Simulate a Multiple State Speciation and Extinction (MuSSE) model.
simulate_ou_model

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

Squared-change parsimony ancestral state reconstruction.