Skip to content
isaac-6Public

About

Biomarker Discovery Using Composite Value Ratios

Resources

Code of conduct

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

biodiscvr: Biomarker Discovery Using Composite Value Ratios

status DOI Lifecycle: stable License: GPL v3 or later R-CMD-check

Overview

biodiscvr provides a framework for discovering and evaluating novel or optimised biomarkers defined as ratios of composite values derived from feature sets (e.g., regional measurements from imaging data). It is particularly suited for analysing longitudinal multi-cohort datasets.

The core functionality uses a Genetic Algorithm (GA) to search the feature space for optimal numerator and denominator combinations based on biomarker performance metrics calculated using linear mixed-effects models (Group Separation, Sample Size Estimates).

Notes:

  • Requires R 4.1.0 or later. Developed with R 4.5; the test suite also passes on R 4.4.
  • Although the underlying methodology is domain‑agnostic, the current implementation is tailored to Alzheimer’s disease (AD) research, reflecting the datasets and use cases that motivated the package. Several preprocessing steps, expected column names, and default region conventions are AD‑specific. Users applying biodiscvr to other domains may need to adjust variable names or modify preprocessing functions. For a guide on how to adapt this framework to non-AD datasets, see the Contributing (“Adapting to Other Research Domains”) section below.

Installation

if (!require("remotes")) install.packages("remotes")
remotes::install_github("isaac-6/biodiscvr", ref = "v2.0.0")

Add build_vignettes = TRUE to also build the vignettes (needs pandoc, and is slower). The installation also installs the packages listed under Imports in DESCRIPTION.

Offline installation

biodiscvr has no compiled code, so Rtools is not needed. Download biodiscvr_<version>.tar.gz from the GitHub Releases page, install the packages listed under Imports with install.packages(), then install the tarball:

install.packages("biodiscvr_<version>.tar.gz", repos = NULL, type = "source")

See the “Installing in restricted environments” section of the main vignette for how to list the packages to request and how to build the tarball yourself.

Getting Started: Workflow Tutorial

The best way to learn how to use the package is through the included vignettes: one walks through the workflow on your own data, the other runs end to end on the bundled synthetic cohorts.

After installing the package with build_vignettes = TRUE, you can access the vignette with:

# Load the package first if needed
# library(biodiscvr)

# Main workflow vignette
vignette("biodiscvr", package = "biodiscvr")

# Synthetic data example
vignette("biodiscvr_synth", package = "biodiscvr")

The vignette covers:

  • Setting up your data directories and output paths.
  • Loading data with load_datasets().
  • Preprocessing data with preprocess_data().
  • Generating demographic tables with create_demographics_table().
  • Running discovery experiments with run_experiments().
  • Evaluating the discovered biomarkers on other cohorts with evaluate_biomarkers().
  • Simplifying biomarkers by regional ablation with run_ablation().

Core Functions

The package provides several key functions for the workflow:

  • load_datasets(): Loads data from structured directories.
  • preprocess_data(): Validates data, prepares SUV columns based on dictionary matching/renaming. Filters data based on minimum entries and inclusion criteria.
  • create_demographics_table(): Generates demographic summary tables.
  • run_experiments(): Orchestrates single- and multi-cohort discovery runs based on an experiments configuration file.
  • evaluate_biomarkers(): Evaluates biomarkers from a results CSV (discovered or predefined) on any datasets and groups, optionally with bootstrap confidence intervals.
  • run_ablation(): Takes a results CSV and iteratively removes regions while this lowers the SSE (uses region_ablation()).

Additional functions to perform single experiments:

  • biodiscvr_single(): Runs the CVR discovery process for a single dataset (typically called by run_experiments).
  • biodiscvr_multicohort(): Runs the CVR discovery process optimised across multiple datasets (typically called by run_experiments).

The bundled inst/files/config_synth.yaml, dict_suv_synth.csv and experiments_synth.yaml are templates for your own configuration, dictionary and experiments files.

Using the results

Rep, SepAB and SSE are computed on the data used to select the biomarker, so read them as a ranking of candidates, not as performance estimates. Selection also uses the amyloid (AB) and diagnosis (DX) labels, so using a biomarker on the same participants to compare those groups, or as an input to a model such as SuStaIn, is partly circular. Evaluate on cohorts not used in discovery (evaluate_biomarkers()), or nest discovery inside the cross-validation of the downstream analysis.

Consult the help page for each function (e.g., ?run_experiments) for detailed argument descriptions.

Limitations

  • With 30 or fewer amyloid-negative visits in a cohort (including none), SepAB is replaced by +1 or -1 from the direction of the biomarker’s slope, and flagged in sepab_placeholder. See ?biodiscvr_single.
  • The within-group model must be (1 | id) or (time | id), and the time column must be called time.
  • Inclusion criteria keep an individual if any visit meets them, and then keep all their visits. Filter your data beforehand if you need baseline-only criteria.

Citation

If you use biodiscvr in your research, please cite the JOSS paper and the software (citation("biodiscvr") returns both after installation), and the paper that describes the method:

  • Software paper: Llorente-Saguer, I. and Oxtoby, N. P. (2026). biodiscvr: Biomarker Discovery Using Composite Value Ratios. Journal of Open Source Software, 11(119), 9070. doi:10.21105/joss.09070
  • Method: Llorente-Saguer, I. et al. (2024). A data-driven framework for biomarker discovery applied to optimizing modern clinical and preclinical trials on Alzheimer’s disease. Brain Communications, 6(6). doi:10.1093/braincomms/fcae438
  • Software, all versions (Zenodo concept DOI, always resolves to the latest release): doi:10.5281/zenodo.18621403

Contributing

Contributions to biodiscvr are welcome! Whether you are reporting a bug, suggesting a feature, or adapting the framework to a new clinical domain, your input is valuable.

Adapting to Other Research Domains

While the default templates are tailored for Alzheimer’s Disease (AD), the core discovery logic is domain-agnostic. To adapt the package to another field (e.g., oncology, cardiology, astronomy), follow these steps:

  1. Modify Configuration: Start from inst/files/config_synth.yaml and set your domain-specific column names and trial parameters (power, effect size, trial time points). After all, the sample size estimate is a measure of longitudinal statistical power.
  2. Custom Preprocessing: If your data requires unique cleaning steps beyond simple renaming, you can modify or extend the logic in R/preprocess.R.
  3. Define New Fitness Metrics: If your clinical goal is not based on t-statistics or sample size estimates (e.g., you want to optimise for Cox Proportional Hazards or AUC), you can implement a custom fitness function in R/evaluation.R and R/search_algorithm.R.
  4. Discovery Logic: The heuristic search logic lives in R/biodiscover.R and R/biodiscvr_multicohort.R (currently a genetic algorithm).

Development Workflow

  1. Fork the repository and create a feature branch.
  2. Submit a Pull Request with a clear description of your changes.
  3. Ensure that any new functions are documented using Roxygen2 comments.
  4. Run R CMD check to ensure the package remains stable.

Reporting Issues

If you find bugs or have questions about implementation, please visit the GitHub Issues page.

Code of Conduct

Please note that the ‘biodiscvr’ project is released with a Contributor Code of Conduct (code_of_conduct.md). By contributing to this project, you agree to abide by its terms.

License

This package is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later). See the LICENSE file for details.

About

Biomarker Discovery Using Composite Value Ratios

Resources

Code of conduct

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages