Title: Phylogenetic Estimation of Shifts in the Tempo of Origination
Version: 0.1.4
Description: Implements diversification analyses using the phylogenetic birth-death-shift model. It leverages belief propagation techniques to calculate branch-specific diversification rates, see Kopperud & Hoehna (2025) <doi:10.1093/sysbio/syaf041>.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: tidytree, treeio, ape
Config/rextendr/version: 0.4.2
SystemRequirements: Cargo (Rust's package manager), rustc
Depends: R (≥ 4.2)
NeedsCompilation: yes
Packaged: 2025-11-21 10:49:56 UTC; bkopper
Author: Bjørn Tore Kopperud [aut, cre], Sebastian Höhna [aut]
Maintainer: Bjørn Tore Kopperud <kopperud@protonmail.com>
Repository: CRAN
Date/Publication: 2025-11-26 14:00:02 UTC

RPesto: Phylogenetic Estimation of Shifts in the Tempo of Origination (in R)

Description

Implements diversification analyses using the phylogenetic birth-death-shift model. It leverages belief propagation techniques to calculate branch-specific diversification rates, see Kopperud & Hoehna (2025) doi:10.1093/sysbio/syaf041.

References

Author(s)

Maintainer: Bjørn Tore Kopperud kopperud@protonmail.com

Authors:


Phylogeny constructor

Description

Constructs a phylogeny that lives in the "rust" part of the program

Usage

Phylogeny(newick)

Arguments

newick

a newick string

Format

An object of class environment of length 10.

Examples

phy <- Phylogeny$new("((A:0.5,B:0.5):0.5,C:1.0);")

phy$print()

phy$write_newick()


fits the bds model

Description

fits the bds model

Usage

fit_bds(
  phy,
  sampling_fraction,
  lambda_hat,
  mu_hat,
  eta,
  num_speciation_classes = 6,
  num_extinction_classes = 6,
  sd = 0.587,
  tol = 1e-06,
  condition_survival = TRUE,
  condition_root_speciation = TRUE,
  condition_marginal = FALSE,
  extinction_approximation = FALSE,
  verbose = FALSE,
  numthreads = 0
)

Arguments

phy

an object of type phylo

sampling_fraction

the probability that each species was sampled in the tree

lambda_hat

the overall scale of the log-normal base distribution for the speciation rates. If not specified, the function will estimate it using ML

mu_hat

the overall scale of the log-normal base distribution for the extinction rates. If not specified, the function will estimate it using ML

eta

the shift rate parameter. If not specified, the function will estimate it using ML

num_speciation_classes

the number of speciation rate class discretizations, such that rate categories is k = n_sp * n_mu

num_extinction_classes

the number of extinction rate class discretizations, such that rate categories is k = n_sp * n_mu

sd

the spread parameter for the log-normal base distribution

tol

the local error threshold in the numerical ODE solver (per delta_t time step)

condition_survival

whether or not to condition on the survival of the left and right lineages descending from the root (default TRUE)

condition_root_speciation

whether or not to condition on that there was a speciation event at the root node (default TRUE)

condition_marginal

whether or condition using the marginal or per-category approach (default FALSE, i.e., to condition per rate category)

extinction_approximation

whether or not to approximate the extinction probability calculations, by assuming that rate shift events are not allowed on extinct lineages (default FALSE)

verbose

whether or not to print more information

numthreads

how many threads to use in likelihood calculation. If 0, then the program uses all available cores

Value

a list with three items: $model (the parameter estimates), $td (a tidytree object with branch-rate estimates), and $tip_rates (a data frame of the tip rates)

Examples

data("primates")

analysis <- fit_bds(primates, sampling_fraction = 0.6, numthreads = 2)



fits the constant-rate birth-death model

Description

fits the constant-rate birth-death model

Usage

fit_cbd(
  phy,
  sampling_fraction,
  tol = 1e-06,
  condition_survival = TRUE,
  condition_root_speciation = TRUE,
  verbose = FALSE
)

Arguments

phy

an object of type phylo

sampling_fraction

the probability that each species was sampled in the tree

tol

the local error threshold in the numerical ODE solver (per delta_t time step)

condition_survival

whether or not to condition on the survival of the left and right lineages descending from the root (default TRUE)

condition_root_speciation

whether or not to condition on that there was a speciation event at the root node (default TRUE)

verbose

whether or not to print more information

Value

a list with the maximum-likelihood parameter estimates of the speciation rate and the extinction rate


Primates phylogenetic tree

Description

This tree is from Vos & Mooers (2006)

Usage

data(primates)

Format

An object of class phylo of length 5.

Details

Vos, R. and A. Mooers. 2006. A new dated supertree of the primates. in Inferring large phylogenies: the big tree problem (R Vos, Phd thesis). Simon Fraser University, Burnaby, British Columbia.


Objects exported from other packages

Description

These objects are imported from other packages. Follow the links below to see their documentation.

tidytree

treedata