Learn R Programming

castor (version 1.8.5)

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

Version

1.8.5

License

GPL (>= 2)

Maintainer

Stilianos Louca

Last Published

January 21st, 2026

Functions in castor (1.8.5)

asr_squared_change_parsimony

Squared-change parsimony ancestral state reconstruction.
castor-package

Efficient computations on large phylogenetic trees.
clade_densities

Estimate the density of tips & nodes in a timetree.
collapse_monofurcations

Remove monofurcations from a tree.
asr_independent_contrasts

Ancestral state reconstruction via phylogenetic independent contrasts.
asr_empirical_probabilities

Empirical ancestral state probabilities.
asr_mk_model

Ancestral state reconstruction with Mk models and rerooting
asr_max_parsimony

Maximum-parsimony ancestral state reconstruction.
asr_subtree_averaging

Ancestral state reconstruction via subtree averaging.
collapse_tree_at_resolution

Collapse nodes of a tree at a phylogenetic resolution.
consensus_taxonomies

Compute consensus taxonomies across a tree.
count_tips_per_node

Count descending tips.
congruent_divergence_times

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

Count number of lineages through time (LTT).
consentrait_depth

Calculate phylogenetic depth of a binary trait using the consenTRAIT metric.
discrete_trait_depth

Calculate phylogenetic depth of a discrete trait.
count_transitions_between_clades

Count the number of state transitions between tips or nodes.
correlate_phylo_geodistances

Correlations between phylogenetic & geographic distances.
evaluate_spline

Evaluate a scalar spline at arbitrary locations.
find_farthest_tip_pair

Find the two most distant tips in a tree.
extract_fasttree_constraints

Extract tree constraints in FastTree alignment format.
date_tree_red

Date a tree based on relative evolutionary divergences.
congruent_hbds_model

Generate a congruent homogenous-birth-death-sampling model.
extend_tree_to_height

Extend a rooted tree up to a specific height.
expanded_tree_from_jplace

Place queries on a tree from a jplace file.
extract_deep_frame

Extract tips representing a tree's deep splits.
expected_distances_sbm

Expected distances traversed by a Spherical Brownian Motion.
exponentiate_matrix

Exponentiate a matrix.
extract_tip_neighborhood

Extract a subtree spanning tips within a certain neighborhood.
extract_tip_radius

Extract a subtree spanning tips within a certain radius.
fit_and_compare_bm_models

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

Find the root of a tree.
find_root_of_monophyletic_tips

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

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

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

Fit and compare Spherical Brownian Motion models for diffusive geographic dispersal between two data sets.
fit_bm_model

Fit a Brownian Motion model for multivariate trait evolution.
fit_hbd_pdr_on_best_grid_size

Fit pulled diversification rates of birth-death models on a time grid with optimal size.
fit_hbd_model_on_grid

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

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