Package: castor 1.8.2

Stilianos Louca

castor:Efficient Phylogenetics on Large Trees

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) <doi:10.1093/bioinformatics/btx701>.

Authors:Stilianos Louca

castor_1.8.2.tar.gz
castor_1.8.2.tar.gz(r-4.5-noble)castor_1.8.2.tar.gz(r-4.4-noble)
castor.pdf |castor.html
castor/json (API)

# Installcastor in R:
install.packages('castor',repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • c++– GNU Standard C++ Library v3

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

136 exports 2 stars 2.05 score 7 dependencies 7 dependents 1.4k downloads

Last updated 6 days agofrom:3fd8671aeb

Exports:asr_empirical_probabilitiesasr_independent_contrastsasr_max_parsimonyasr_mk_modelasr_squared_change_parsimonyasr_subtree_averagingclade_densitiescollapse_monofurcationscollapse_tree_at_resolutioncongruent_divergence_timescongruent_hbds_modelconsensus_taxonomiesconsentrait_depthcorrelate_phylo_geodistancescount_lineages_through_timecount_tips_per_nodecount_transitions_between_cladesdate_tree_reddiscrete_trait_depthevaluate_splineexpanded_tree_from_jplaceexpected_distances_sbmexponentiate_matrixextend_tree_to_heightextract_deep_frameextract_fasttree_constraintsextract_tip_neighborhoodextract_tip_radiusfind_farthest_tip_pairfind_farthest_tipsfind_nearest_tipsfind_rootfind_root_of_monophyletic_tipsfit_and_compare_bm_modelsfit_and_compare_sbm_constfit_bm_modelfit_hbd_model_on_gridfit_hbd_model_parametricfit_hbd_pdr_on_best_grid_sizefit_hbd_pdr_on_gridfit_hbd_pdr_parametricfit_hbd_psr_on_best_grid_sizefit_hbd_psr_on_gridfit_hbd_psr_parametricfit_hbds_model_on_gridfit_hbds_model_parametricfit_mkfit_mussefit_sbm_constfit_sbm_geobiased_constfit_sbm_linearfit_sbm_on_gridfit_sbm_parametricfit_tree_modelgamma_statisticgenerate_gene_tree_mscgenerate_gene_tree_msc_hgt_dlgenerate_random_treegenerate_tree_hbd_reversegenerate_tree_hbdsgenerate_tree_with_evolving_ratesgeographic_acfget_all_distances_to_rootget_all_distances_to_tipget_all_node_depthsget_all_pairwise_distancesget_ancestral_nodesget_clade_listget_independent_contrastsget_independent_sister_tipsget_mrca_of_setget_pairwise_distancesget_pairwise_mrcasget_random_diffusivity_matrixget_random_mk_transition_matrixget_redsget_stationary_distributionget_subtree_at_nodeget_subtree_with_tipsget_subtrees_at_nodesget_tips_for_mrcasget_trait_acfget_trait_stats_over_timeget_transition_index_matrixget_tree_spanget_tree_traversal_root_to_tipshsp_binomialhsp_empirical_probabilitieshsp_independent_contrastshsp_max_parsimonyhsp_mk_modelhsp_nearest_neighborhsp_squared_change_parsimonyhsp_subtree_averagingis_bifurcatingis_monophyleticjoin_rooted_treesloglikelihood_hbdmap_to_state_spacemean_abs_change_scalar_oumerge_nodes_to_multifurcationsmerge_short_edgesmodel_adequacy_hbdmodel_adequacy_hbdsmultifurcations_to_bifurcationspick_random_tipsplace_tips_taxonomicallyread_treereconstruct_past_diversificationreorder_tree_edgesroot_at_midpointroot_at_noderoot_in_edgeroot_via_outgrouproot_via_rttshift_clade_timessimulate_bm_modelsimulate_deterministic_hbdsimulate_deterministic_hbdssimulate_diversification_modelsimulate_dssesimulate_mk_modelsimulate_mussesimulate_ou_modelsimulate_rou_modelsimulate_sbmsimulate_tdssespline_coefficientssplit_tree_at_heighttree_distancetree_from_branching_agestree_from_sampling_branching_agestree_from_taxatree_imbalancetrim_tree_at_heightwrite_tree

Dependencies:jsonlitelatticeMatrixnaturalsortRcppRcppEigenRSpectra

Readme and manuals

Help Manual

Help pageTopics
Efficient computations on large phylogenetic trees.castor-package castor
Empirical ancestral state probabilities.asr_empirical_probabilities
Ancestral state reconstruction via phylogenetic independent contrasts.asr_independent_contrasts
Maximum-parsimony ancestral state reconstruction.asr_max_parsimony
Ancestral state reconstruction with Mk models and rerootingasr_mk_model
Squared-change parsimony ancestral state reconstruction.asr_squared_change_parsimony
Ancestral state reconstruction via subtree averaging.asr_subtree_averaging
Estimate the density of tips & nodes in a timetree.clade_densities
Remove monofurcations from a tree.collapse_monofurcations
Collapse nodes of a tree at a phylogenetic resolution.collapse_tree_at_resolution
Extract dating anchors for a target tree, using a dated reference treecongruent_divergence_times
Generate a congruent homogenous-birth-death-sampling model.congruent_hbds_model
Compute consensus taxonomies across a tree.consensus_taxonomies
Calculate phylogenetic depth of a binary trait using the consenTRAIT metric.consentrait_depth
Correlations between phylogenetic & geographic distances.correlate_phylo_geodistances
Count number of lineages through time (LTT).count_lineages_through_time
Count descending tips.count_tips_per_node
Count the number of state transitions between tips or nodes.count_transitions_between_clades
Date a tree based on relative evolutionary divergences.date_tree_red
Calculate phylogenetic depth of a discrete trait.discrete_trait_depth
Evaluate a scalar spline at arbitrary locations.evaluate_spline
Place queries on a tree from a jplace file.expanded_tree_from_jplace
Expected distances traversed by a Spherical Brownian Motion.expected_distances_sbm
Exponentiate a matrix.exponentiate_matrix
Extend a rooted tree up to a specific height.extend_tree_to_height
Extract tips representing a tree's deep splits.extract_deep_frame
Extract tree constraints in FastTree alignment format.extract_fasttree_constraints
Extract a subtree spanning tips within a certain neighborhood.extract_tip_neighborhood
Extract a subtree spanning tips within a certain radius.extract_tip_radius
Find the two most distant tips in a tree.find_farthest_tip_pair
Find farthest tip to each tip & node of a tree.find_farthest_tips
Find nearest tip to each tip & node of a tree.find_nearest_tips
Find the root of a tree.find_root
Find the node or tip that, as root, would make a set of target tips monophyletic.find_root_of_monophyletic_tips
Fit and compare Brownian Motion models for multivariate trait evolution between two data sets.fit_and_compare_bm_models
Fit and compare Spherical Brownian Motion models for diffusive geographic dispersal between two data sets.fit_and_compare_sbm_const
Fit a Brownian Motion model for multivariate trait evolution.fit_bm_model
Fit a homogenous birth-death model on a discrete time grid.fit_hbd_model_on_grid
Fit a parametric homogenous birth-death model to a timetree.fit_hbd_model_parametric
Fit pulled diversification rates of birth-death models on a time grid with optimal size.fit_hbd_pdr_on_best_grid_size
Fit pulled diversification rates of birth-death models on a time grid.fit_hbd_pdr_on_grid
Fit parameterized pulled diversification rates of birth-death models.fit_hbd_pdr_parametric
Fit pulled speciation rates of birth-death models on a time grid with optimal size.fit_hbd_psr_on_best_grid_size
Fit pulled speciation rates of birth-death models on a time grid.fit_hbd_psr_on_grid
Fit parameterized pulled speciation rates of birth-death models.fit_hbd_psr_parametric
Fit a homogenous birth-death-sampling model on a discrete time grid.fit_hbds_model_on_grid
Fit a parametric homogenous birth-death-sampling model to a timetree.fit_hbds_model_parametric
Fit a Markov (Mk) model for discrete trait evolution.fit_mk
Fit a discrete-state-dependent diversification model via maximum-likelihood.fit_musse
Fit a phylogeographic Spherical Brownian Motion model.fit_sbm_const
Fit a phylogeographic Spherical Brownian Motion model with geographic sampling bias.fit_sbm_geobiased_const
Fit a phylogeographic Spherical Brownian Motion model with linearly varying diffusivity.fit_sbm_linear
Fit a phylogeographic Spherical Brownian Motion model with piecewise-linear diffusivity.fit_sbm_on_grid
Fit a time-dependent phylogeographic Spherical Brownian Motion model.fit_sbm_parametric
Fit a cladogenic model to an existing tree.fit_tree_model
Calculate the gamma-statistic of a tree.gamma_statistic
Generate a gene tree based on the multi-species coalescent model.generate_gene_tree_msc
Generate gene trees based on the multi-species coalescent, horizontal gene transfers and duplications/losses.generate_gene_tree_msc_hgt_dl
Generate a tree using a Poissonian speciation/extinction model.generate_random_tree
Generate a tree from a birth-death model in reverse time.generate_tree_hbd_reverse
Generate a tree from a birth-death-sampling model in forward time.generate_tree_hbds
Generate a random tree with evolving speciation/extinction rates.generate_tree_with_evolving_rates
Phylogenetic autocorrelation function of geographic locations.geographic_acf
Get distances of all tips and nodes to the root.get_all_distances_to_root
Get distances of all tips/nodes to a focal tip.get_all_distances_to_tip
Get the phylogenetic depth of each node in a tree.get_all_node_depths
Get distances between all pairs of tips and/or nodes.get_all_pairwise_distances
Compute ancestral nodes.get_ancestral_nodes
Get a representation of a tree as a table listing tips/nodes.get_clade_list
Phylogenetic independent contrasts for continuous traits.get_independent_contrasts
Extract disjoint tip pairs with independent relationships.get_independent_sister_tips
Most recent common ancestor of a set of tips/nodes.get_mrca_of_set
Get distances between pairs of tips or nodes.get_pairwise_distances
Get most recent common ancestors of tip/node pairs.get_pairwise_mrcas
Create a random diffusivity matrix for a Brownian motion model.get_random_diffusivity_matrix
Create a random transition matrix for an Mk model.get_random_mk_transition_matrix
Calculate relative evolutionary divergences in a tree.get_reds
Stationary distribution of Markov transition matrix.get_stationary_distribution
Extract a subtree descending from a specific node.get_subtree_at_node
Extract a subtree spanning a specific subset of tips.get_subtree_with_tips
Extract subtrees descending from specific nodes.get_subtrees_at_nodes
Find tips with specific most recent common ancestors.get_tips_for_mrcas
Phylogenetic autocorrelation function of a numeric trait.get_trait_acf
Calculate mean & standard deviation of a numeric trait on a dated tree over time.get_trait_stats_over_time
Create an index matrix for a Markov transition model.get_transition_index_matrix
Get min and max distance of any tip to the root.get_tree_span
Traverse tree from root to tips.get_tree_traversal_root_to_tips
Hidden state prediction for a binary trait based on the binomial distribution.hsp_binomial
Hidden state prediction via empirical probabilities.hsp_empirical_probabilities
Hidden state prediction via phylogenetic independent contrasts.hsp_independent_contrasts
Hidden state prediction via maximum parsimony.hsp_max_parsimony
Hidden state prediction with Mk models and rerootinghsp_mk_model
Hidden state prediction based on nearest neighbor.hsp_nearest_neighbor
Hidden state prediction via squared-change parsimony.hsp_squared_change_parsimony
Hidden state prediction via subtree averaging.hsp_subtree_averaging
Determine if a tree is bifurcating.is_bifurcating
Determine if a set of tips is monophyletic.is_monophyletic
Join two rooted trees.join_rooted_trees
Galculate the log-likelihood of a homogenous birth-death model.loglikelihood_hbd
Map states of a discrete trait to integers.map_to_state_space
Compute the expected absolute change of an Ornstein-Uhlenbeck process.mean_abs_change_scalar_ou
Merge specific nodes into multifurcations.merge_nodes_to_multifurcations
Eliminate short edges in a tree by merging nodes into multifurcations.merge_short_edges
Check if a birth-death model adequately explains a timetree.model_adequacy_hbd
Check if a birth-death-sampling model adequately explains a timetree.model_adequacy_hbds
Expand multifurcations to bifurcations.multifurcations_to_bifurcations
Pick random subsets of tips on a tree.pick_random_tips
Place queries on a tree based on taxonomic identities.place_tips_taxonomically
Load a tree from a string or file in Newick (parenthetic) format.read_tree
Reconstruct past diversification dynamics from a diversity time series.reconstruct_past_diversification
Reorder tree edges in preorder or postorder.reorder_tree_edges
Root a tree at the midpoint node.root_at_midpoint
Root a tree at a specific node.root_at_node
Root a tree in the middle of an edge.root_in_edge
Root a tree based on an outgroup tip.root_via_outgroup
Root a tree via root-to-tip regression.root_via_rtt
Shift the time of specific nodes & tips.shift_clade_times
Simulate a Brownian motion model for multivariate trait co-evolution.simulate_bm_model
Simulate a deterministic homogenous birth-death model.simulate_deterministic_hbd
Simulate a deterministic homogenous birth-death-sampling model.simulate_deterministic_hbds
Simulate a deterministic uniform speciation/extinction model.simulate_diversification_model
Simulate a Discrete-State Speciation and Extinction (dSSE) model.simulate_dsse simulate_musse
Simulate an Mk model for discrete trait evolution.simulate_mk_model
Simulate an Ornstein-Uhlenbeck model for continuous trait evolution.simulate_ou_model
Simulate a reflected Ornstein-Uhlenbeck model for continuous trait evolution.simulate_rou_model
Simulate Spherical Brownian Motion on a tree.simulate_sbm
Simulate a time-dependent Discrete-State Speciation and Extinction (tdSSE) model.simulate_tdsse
Get the polynomial coefficients of a spline.spline_coefficients
Split a tree into subtrees at a specific height.split_tree_at_height
Calculate the distance between two trees.tree_distance
Generate a random timetree with specific branching ages.tree_from_branching_ages
Generate a random timetree with specific tip/sampling and node/branching ages.tree_from_sampling_branching_ages
Construct a rooted tree from lists of taxa.tree_from_taxa
Calculate various imbalance statistics for a tree.tree_imbalance
Trim a rooted tree down to a specific height.trim_tree_at_height
Write a tree in Newick (parenthetic) format.write_tree