Crandore Hub

metamorphr

Tidy and Streamlined Metabolomics Data Workflows

Facilitate tasks typically encountered during metabolomics data analysis including data import, filtering, missing value imputation (Stacklies et al. (2007) <doi:10.1093/bioinformatics/btm069>, Stekhoven et al. (2012) <doi:10.1093/bioinformatics/btr597>, Tibshirani et al. (2017) <doi:10.18129/B9.BIOC.IMPUTE>, Troyanskaya et al. (2001) <doi:10.1093/bioinformatics/17.6.520>), normalization (Bolstad et al. (2003) <doi:10.1093/bioinformatics/19.2.185>, Dieterle et al. (2006) <doi:10.1021/ac051632c>, Zhao et al. (2020) <doi:10.1038/s41598-020-72664-6>) transformation, centering and scaling (Van Den Berg et al. (2006) <doi:10.1186/1471-2164-7-142>) as well as statistical tests and plotting. 'metamorphr' introduces a tidy (Wickham et al. (2019) <doi:10.21105/joss.01686>) format for metabolomics data and is designed to make it easier to build elaborate analysis workflows and to integrate them with 'tidyverse' packages including 'dplyr' and 'ggplot2'.

README

<!-- README.md is generated from README.Rmd. Please edit that file -->

# metamorphr <a href="https://yasche.github.io/metamorphr/"><img src="man/figures/logo.png" align="right" height="138" alt="metamorphr website" /></a>

<!-- badges: start -->

[![CRAN
status](https://www.r-pkg.org/badges/version/metamorphr)](https://cran.r-project.org/package=metamorphr)
[![Codecov test
coverage](https://codecov.io/gh/yasche/metamorphr/graph/badge.svg)](https://app.codecov.io/gh/yasche/metamorphr)
[![R-CMD-check](https://github.com/yasche/metamorphr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/yasche/metamorphr/actions/workflows/R-CMD-check.yaml)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->

## 💡 Overview

The metamorphr package is intended to make working with metabolomics
data more fun. For this, metamorphr introduces a
[tidy](https://cran.r-project.org/package=tidyr/vignettes/tidy-data.html)
data format which stores metabolomics data and associated metadata, as
well as MS/MS spectra in one [tibble](https://tibble.tidyverse.org/) and
includes a set of functions to facilitate tasks typically encountered
during metabolomics data analysis. This approach allows for an easy
integration with [Tidyverse](https://tidyverse.org/) packages, including
ggplot2 and dplyr.

## 💾 Installation

Install the stable version from CRAN with:

``` r
install.packages("metamorphr")
```

Alternatively, you can install the development version of metamorphr
from [GitHub](https://github.com/) with:

``` r
# install.packages("pak")
pak::pak("yasche/metamorphr")
```

## ⚙️ Functions

Here is an overview of currently implemented functions.

![](man/figures/functions.svg)

## 📑 Examples

### ✨ Create your analysis workflows in no time

``` r
library(metamorphr)
library(ggplot2)

toy_metaboscape %>%
  join_metadata(toy_metaboscape_metadata) %>%
  filter_blank(blank_samples = "blank",
               blank_as_group = T,
               group_column = Group) %>%
  filter_grouped_mv(min_found = 0.75) %>%
  impute_lod() %>%
  normalize_pqn() %>%
  scale_auto() %>%
  plot_pca(group_column = Group) +
    ggplot2::theme_bw()
```

<img src="man/figures/README-example-workflow-1.svg" width="100%" />

### 📊 Seamlessly work with your data sets with dplyr and ggplot2

Easily plot the distribution of all intensities across samples

``` r
library(dplyr)

toy_metaboscape %>%
  join_metadata(toy_metaboscape_metadata) %>%
  ggplot2::ggplot(ggplot2::aes(Sample, Intensity, color = Group)) +
    ggplot2::geom_boxplot() +
    ggplot2::theme_bw()
```

<img src="man/figures/README-example-dplyr-1-1.svg" width="100%" />

… or compare the intensity of specific features across groups

``` r
toy_metaboscape %>%
  join_metadata(toy_metaboscape_metadata) %>%
  dplyr::filter(Name %in% c("Arachidonic acid", "ADP", "NADPH")) %>%
  dplyr::filter(Group %in% c("control", "treatment")) %>%
  ggplot2::ggplot(ggplot2::aes(Group, Intensity, color = Group)) +
    ggplot2::geom_boxplot() +
    ggplot2::facet_wrap(~Name) +
    ggplot2::theme_bw()
```

<img src="man/figures/README-example-dplyr-2-1.svg" width="100%" />

Versions across snapshots

VersionRepositoryFileSize
0.3.0 rolling linux/jammy R-4.5 metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 rolling linux/noble R-4.5 metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 rolling source/ R- metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 latest linux/jammy R-4.5 metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 latest linux/noble R-4.5 metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 latest source/ R- metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 2026-04-26 source/ R- metamorphr_0.3.0.tar.gz 491.8 KiB
0.3.0 2026-04-23 source/ R- metamorphr_0.3.0.tar.gz 491.8 KiB

Dependencies (latest)

Imports

Suggests