metabom8

R library for 1D NMR metabolomics workflows. Features include Bruker NMR data import and preprocessing, statistical modeling (PCA, O-PLS), metabolite identification, and visualization (ggplot2, plotly). Critical functions are implemented in C++ using linear algebra libraries (Armadillo, Eigen) to enhance runtime performance.

https://github.com/tkimhofer/metabom8

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

armadillo eigen rcpp
Last synced: 6 months ago · JSON representation

Repository

R library for 1D NMR metabolomics workflows. Features include Bruker NMR data import and preprocessing, statistical modeling (PCA, O-PLS), metabolite identification, and visualization (ggplot2, plotly). Critical functions are implemented in C++ using linear algebra libraries (Armadillo, Eigen) to enhance runtime performance.

Basic Info
  • Host: GitHub
  • Owner: tkimhofer
  • License: other
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 106 MB
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 5
  • Open Issues: 0
  • Releases: 2
Topics
armadillo eigen rcpp
Created almost 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Code of conduct

README.md

metabom8

An R library for NMR-based metabolic profiling

metabom8 (pronounced metabo-mate) provides pipelines for 1D NMR data import, preprocessing, multivariate modeling (PCA, O-PLS), metabolite identification, and visualization — with core functions accelerated using C++ (Rcpp, Armadillo, Eigen) for improved computational performance.


🛠️ Features

  • Preprocessing and analysis of 1D NMR spectra
  • Prinicpal Component Analysis (PCA) and backscaled model loadings
  • Orthogonal Partial Least Squares (OPLS) modeling via the NIPALS algorithm
  • OPLS with automatic selection of the optimal number of components based on R2, Q2 and cross-valdated AUC
  • Robust statistical validation for small to large sample sizes: stratified Monte Carlo CV and k-fold CV
  • Custom model visualisations using ggplot2 and plotly
  • Model diagnostics & validation (DModX, Permutation Testing)
  • Metabolite identification via STOCSY and STORM
  • Native C++ acceleration via RcppArmadillo and RcppEigen

📦 Installation

r install.packages("remotes") remotes::install_github("tkimhofer/metabom8")


🚀 Quick Start

```r library(metabom8) library(nmrdata)

Load example data

data(bariatric, package = "nmrdata")

idx <- bariatric$an$Class %in% c("Pre-op", "RYGB") X <- bariatric$X.pqn[idx, ] Y <- bariatric$an$Class[idx]

Fit an OPLS model using Monte Carlo Cross-Valdation

model <- opls( X = X, Y = Y, center = TRUE, scale = "UV", cv = list(method = "MC", k = 7, split=2/3) )

Plot scores and loadings

plotscores(model) plotload(model) ```


⚡ Performance

Benchmarked against the ropls package under identical conditions using the bench package:

r bench::mark( metabom8 = metabom8::opls(X, Y, ...), ropls = ropls::opls(X, Y, predI = 1, orthoI = 1, ...), check = FALSE )

| Method | Median Time | Iter/sec | Memory Use | |------------|-------------|----------|------------| | metabom8 | 1.61 sec | 0.621 | 2.81 GB | | ropls | 3.95 sec | 0.253 | 1.61 GB |

metabom8 provides a ~2.5× speed-up using C++ linear algebra (Eigen, Armadillo) when compared to widely used implementations [^1].

[^1]: Benchmark comparison uses the ropls package (Bioconductor), a widely used OPLS implementation (parameters: uv scaling, 7-fold CV, 1 predictive + 1 orthogonal component).

📘 Documentation

Comprehensive documentation and vignettes are available at:
🔗 https://tkimhofer.github.io/metabom8/


🔗 Related Packages

  • nmrdata: Example dataset for NMR spectral analysis (used for performance comparison)

If you find metabom8 useful, please consider giving it a ⭐ — it makes it easier for others to discover the project!


📝 License & Citation

MIT License © Torben Kimhofer
If metabom8 or any of its components contributes to your work, please ensure appropriate citation. See CITATION for citation details.


🙋 Getting Help

  • Found a bug? Open an issue
  • Want to contribute? Fork the repo and submit a pull request
  • Code of Conduct: see CODE_OF_CONDUCT.md

Built with 💙 by @tkimhofer

Owner

  • Name: Torben Kimhofer
  • Login: tkimhofer
  • Kind: user

Data enthusiast and scientist.

GitHub Events

Total
  • Push event: 71
  • Pull request event: 17
  • Fork event: 1
  • Create event: 2
Last Year
  • Push event: 71
  • Pull request event: 17
  • Fork event: 1
  • Create event: 2

Dependencies

DESCRIPTION cran
  • R >= 4.0 depends
  • RColorBrewer * imports
  • Rcpp >= 1.0.4.6 imports
  • abind * imports
  • colorRamps * imports
  • ellipse * imports
  • ggplot2 * imports
  • ggrepel * imports
  • grDevices * imports
  • graphics * imports
  • methods * imports
  • pROC * imports
  • parallel * imports
  • pcaMethods * imports
  • plotly * imports
  • plyr * imports
  • ptw * imports
  • reshape2 * imports
  • scales * imports
  • signal * imports
  • stats * imports
  • utils * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests