pkgdown/extra-head.html

Skip to contents

Branch-level Inference Framework for Recognizing Optimal Shifts in Traits

bifrost performs branch-level inference of multi-regime, multivariate trait evolution on a phylogeny using penalized-likelihood multivariate GLS fits. The current version searches for evolutionary model shifts under a multi-rate Brownian Motion (BMM) model with proportional regime VCV scaling, operates directly in trait space (for example, without PCA), and is designed for high-dimensional datasets (p > n) and large trees (> 1000 tips). The method works with fossil tip-dated trees and with a wide range of multivariate comparative data, including GPA-aligned morphometric coordinates, linear dimensions, and related trait matrices. A future major release will add support for the multivariate scalar Ornstein-Uhlenbeck process.

Installation

Stable release

install.packages("bifrost")

Development version

# install.packages("remotes")
remotes::install_github("jakeberv/bifrost")

Windows users:
Install Rtools for your R version and ensure that it is added to your system PATH.

macOS users:
You may need to install XQuartz to build or run packages that depend on certain graphical or system libraries.

Overview

  • Primary goal. Infer where, when, and how patterns of phenotypic evolution change across a tree using many traits simultaneously.
  • Model. Multi-rate Brownian Motion with regime-specific VCVs estimated via penalized-likelihood (mvMORPH::mvgls), supporting p >= n.
  • Search. Greedy, step-wise acceptance of shifts guided by information criteria (GIC or BIC), with optional per-shift IC weights.
  • Scale. Parallel candidate scoring using the future ecosystem; practical on thousands of taxa x traits.

Key features

  • Joint multivariate modeling without information loss or distortion due to PCA.
  • Under BMM, proportional VCV scaling across regimes for tractability at high p.
  • Provides a multivariate phylogenetic GLS (mvPGLS)-like framework in which hidden branch-specific rate regimes are inferred and incorporated when estimating predictor effects.
  • Candidate shift nodes are determined by a minimum clade size specified by the user.
  • Greedy step-wise heuristic search using GIC/BIC delta-IC thresholds, with optional IC-weight support for inferred shifts.
  • Output includes estimated VCV per regime, shift weights, and SIMMAP-style mappings for downstream visualization and analysis.
  • Parallelization via future and future.apply.

Documentation

Background and theory

Using bifrost

Additional note

Though bifrost was initially developed as a framework for inferring macroevolutionary regime shifts in multivariate trait data, it can also be applied to perform multivariate phylogenetic generalized least squares (pGLS) analyses with factors or continuous predictors (e.g., cbind(trait1, trait2, ...) ~ predictor, or "trait_data[, 1:5] ~ trait_data[, 6]" when working directly with a matrix). In this context, bifrost identifies branch-specific rate variation under a multi-rate Brownian Motion model and fits the pGLS conditional on the resulting residual (phylogenetic) covariance structure, so estimated effect sizes and uncertainties account for “hidden” rate variation not explained by the predictors. This is conceptually similar to hidden-state approaches (e.g., Boyko et al. 2023), except that here the regimes influence variance and evolutionary rate rather than introducing regime-specific means. This use case is an active area of ongoing methodological development.

Citation

If you use bifrost, please cite the references returned by:

citation("bifrost")

Contributing

Bug reports, feature requests, and pull requests are welcome. Please open an issue at https://github.com/jakeberv/bifrost/issues.

License

This project is released under the GPL (>= 2) License. See the LICENSE file for details.

Acknowledgements and dependencies

bifrost builds on substantial work from mvMORPH, phytools, ape, future, and future.apply. The greedy search algorithm is adapted from Mitov et al. 2019 and Smith et al. 2023. See the DESCRIPTION file for complete dependency and version information.

The name of our R package is inspired by the Bifrost, the rainbow bridge of Norse mythology that connects Earth (Midgard) and Asgard within the cosmic structure of Yggdrasil, the Tree of Life, echoing how this framework links observable data to hidden evolutionary shifts across the history of life.

Development of the bifrost R package was supported by the Oxford Research Software Engineering Group, with support from Schmidt Sciences, LLC. and the Michigan Institute for Data Science and AI in Society.

Schmidt Sciences logoOxford RSE logo