Learn R Programming

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

castor (version 1.3)

Efficient Phylogenetics on Large Trees

Description

Efficient tree manipulations for large phylogenies, including 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, using Maximum Likelihood and Maximum Parsimony methods. Simulating and fitting models of trait evolution, and generating random trees using birth-death models.

Copy Link

Version

Install

install.packages('castor')

Monthly Downloads

1,735

Version

1.3

License

GPL (>= 2)

Maintainer

Stilianos Louca

Last Published

November 29th, 2017

Functions in castor (1.3)

count_clades_over_time

Count number of clades over time.
asr_empirical_probabilities

Empirical ancestral state probabilities.
count_tips_per_node

Count descending tips.
collapse_monofurcations

Remove monofurcations from a tree.
asr_max_parsimony

Maximum-parsimony ancestral state reconstruction.
asr_mk_model

Ancestral state reconstruction with Mk models and rerooting
collapse_tree_at_resolution

Collapse nodes of a tree at a phylogenetic resolution.
asr_independent_contrasts

Ancestral state reconstruction via phylogenetic independent contrasts.
find_nearest_tips

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

Squared-change parsimony ancestral state reconstruction.
fit_tree_model

Fit a cladogenic model to an existing tree.
castor-package

Efficient computations on large phylogenetic trees.
extend_tree_to_height

Extend a rooted tree up to a specific height.
generate_random_tree

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

Find the root of a tree.
generate_tree_with_evolving_rates

Generate a random tree with birth/death rates evolving under Brownian motion.
find_root_of_monophyletic_tips

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

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

Fit a Brownian motion model for multivariate trait evolution.
get_stationary_distribution

Stationary distribution of Markov transition matrix.
find_farthest_tips

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

Create a random transition matrix for an Mk model.
exponentiate_matrix

Exponentiate a matrix.
get_pairwise_distances

Get distances between pairs of tips or nodes.
get_pairwise_mrcas

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

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

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

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

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

Phylogenetic independent contrasts for continuous traits.
get_tree_traversal_root_to_tips

Traverse tree from root to tips.
get_subtree_with_tips

Extract a subtree spanning a specific subset of tips.
get_subtree_at_node

Extract a subtree descending from a specific node.
get_trait_acf

Phylogenetic autocorrelation function of a numeric trait.
get_tips_for_mrcas

Find tips with specific most recent common ancestors.
get_trait_depth

Calculate depth of phylogenetic conservatism for a binary trait.
hsp_independent_contrasts

Hidden state prediction via phylogenetic independent contrasts.
hsp_empirical_probabilities

Hidden state prediction via empirical probabilities.
hsp_max_parsimony

Hidden state prediction via maximum parsimony.
pick_random_tips

Pick random subsets of tips on a tree.
merge_short_edges

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

Reconstruct past diversification dynamics from a diversity time series.
multifurcations_to_bifurcations

Expand multifurcations to bifurcations.
simulate_diversification_model

Simulate a speciation/extinction model.
root_at_node

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

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

Simulate an Mk model for discrete trait evolution.
hsp_mk_model

Hidden state prediction with Mk models and rerooting
reorder_tree_edges

Reorder tree edges in preorder or postorder.
hsp_squared_change_parsimony

Hidden state prediction via squared-change parsimony.
root_at_midpoint

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

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

Trim a rooted tree down to a specific height.
simulate_rou_model

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

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

Write a tree in Newick (parenthetic) format.
is_monophyletic

Determine if a set of tips is monophyletic.
map_to_state_space

Map states of a discrete trait to integers.
root_via_outgroup

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

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