Learn R Programming

cladoRcpp (version 0.15.1)

C++ Implementations of Phylogenetic Cladogenesis Calculations

Description

Various cladogenesis-related calculations that are slow in pure R are implemented in C++ with Rcpp. These include the calculation of the probability of various scenarios for the inheritance of geographic range at the divergence events on a phylogenetic tree, and other calculations necessary for models which are not continuous-time markov chains (CTMC), but where change instead occurs instantaneously at speciation events. Typically these models must assess the probability of every possible combination of (ancestor state, left descendent state, right descendent state). This means that there are up to (# of states)^3 combinations to investigate, and in biogeographical models, there can easily be hundreds of states, so calculation time becomes an issue. C++ implementation plus clever tricks (many combinations can be eliminated a priori) can greatly speed the computation time over naive R implementations. CITATION INFO: This package is the result of my Ph.D. research, please cite the package if you use it! Type: citation(package="cladoRcpp") to get the citation information.

Copy Link

Version

Install

install.packages('cladoRcpp')

Monthly Downloads

481

Version

0.15.1

License

GPL (>= 2)

Maintainer

Nicholas J. Matzke

Last Published

November 21st, 2018

Functions in cladoRcpp (0.15.1)

Rcpp_combn_zerostart

Get all the combinations of descendent state pairs, in 0-based index form
cladoRcpp-package

Phylogenetic probability calculations using Rcpp
rcpp_calc_anclikes_sp_rowsums

Calculate the number of cladogenesis events of nonzero probability for each ancestral state
strsplit3

String splitting shortcut
rcpp_calc_anclikes_sp_using_COOprobs

Calculate ancestral likelihoods given a COO-like probability matrix
rcpp_calc_rowsums_for_COOweights_columnar

Calculate sum of weights for each ancestral state
rcpp_mult2probvect

Get the product of multiplying each pair of values in a vector (cross-product)
rcpp_calc_anclikes_sp

Calculate probability of ancestral states below a speciation event, given probabilities of the states on each descendant branch
rcpp_states_list_to_DEmat

C++ conversion of a states list to a dispersal-extinction matrix (DEmat)
rcpp_calc_splitlikes_using_COOweights_columnar

Calculate the split likelihoods using COO_weights_columnar
rcpp_convolve

Run C++ version of convolve(x,y, conj=TRUE, type="open")
areas_list_to_states_list_old

Convert a list of areas to a list of geographic ranges (states); original R version
numstates_from_numareas

Calculate the number of states, given a certain number of areas
rcpp_calc_anclikes_sp_COOprobs

Faster version of rcpp_calc_anclikes_sp
rcpp_calc_anclikes_sp_COOweights_faster

Even faster version of rcpp_calc_anclikes_sp
rcpp_areas_list_to_states_list

Make a list of 0-based indices of possible combinations of input areas
rcpp_calc_anclikes_sp_prebyte

Calculate probability of ancestral states below a speciation event, given probabilities of the states on each descendant branch