Skip to content
Back to skills

Multiple Testing Correction Bonferroni

ASecurity

Use when when you have computed raw p-values for multiple independent

  • 16 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 12, 2026
ai-agentstestinggit

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add HolobiomicsLab/asb-skill-collections --skill multiple-testing-correction-bonferroni --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Multiple Testing Correction Bonferroni?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Multiple Testing Correction Bonferroni
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/holobiomicslab-multiple-testing-correction-bonferroni-asb-skill-collections/badge)](https://www.skillsdirectory.com/skills/holobiomicslab-multiple-testing-correction-bonferroni-asb-skill-collections)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: multiple-testing-correction-bonferroni
description: Use when when you have computed raw p-values for multiple independent
  statistical tests (e.g., Pearson correlation tests across all pairwise ion combinations
  in MSI data) and need to report which results remain significant after accounting
  for multiple comparisons.
license: CC-BY-4.0
metadata:
  edam_operation: http://edamontology.org/operation_3799
  edam_topics:
  - http://edamontology.org/topic_3520
  - http://edamontology.org/topic_3179
  tools:
  - mass2adduct
  - R
  - corrPairsMSI
  - corrPairsMSIchunks
  - mass2adduct (R package)
  techniques:
  - MS-imaging
  license_tier: open
  provenance_tier: literature
derived_from:
- doi: 10.1021/acs.analchem.0c04720
  title: mass2adduct
evidence_spans:
- This package presents tools for counting and identifying possible adducts in MS
  data
- library(mass2adduct)
claims: []
provenance:
  collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
  assembled_by: scripts/collect_metabolomics_collection.py
  sources:
  - build: coll_mass2adduct
    doi: 10.1021/acs.analchem.0c04720
    title: mass2adduct
  dedup_kept_from: coll_mass2adduct
schema_version: 0.2.0
attribution:
  generator: AgenticScienceBuilder
  original_doi: 10.1021/acs.analchem.0c04720
  all_source_dois:
  - 10.1021/acs.analchem.0c04720
  zenodo_doi: 10.5281/zenodo.20794027
  curators: []
  promoter: Louis-Félix Nothias
  sponsor: CNRS & Université Côte d'Azur
---

# Multiple-testing correction (Bonferroni)

## Summary

Apply Bonferroni correction to control false-positive rate when testing statistical significance across many pairwise comparisons in mass spectrometry imaging data. This correction adjusts p-value thresholds by the total number of tests performed, protecting against spurious findings when screening thousands of ion-pair correlations.

## When to use

When you have computed raw p-values for multiple independent statistical tests (e.g., Pearson correlation tests across all pairwise ion combinations in MSI data) and need to report which results remain significant after accounting for multiple comparisons. Bonferroni is appropriate when the number of tests is moderate (hundreds to low thousands) and you can afford conservative significance thresholds.

## When NOT to use

- When you have performed only a single or very few hypothesis tests—Bonferroni correction is overly conservative and unnecessary for small test counts.
- When test results are not independent (e.g., correlated ion pairs)—Bonferroni assumes independence and will be too stringent under positive correlation.
- When you wish to control false-discovery rate (FDR) rather than family-wise error rate—use Benjamini–Hochberg or similar FDR methods instead.

## Inputs

- massdiff object (annotated ion pairs with raw p-values from correlation tests)
- number of statistical tests performed (typically implicit in massdiff object length)
- significance threshold (default α = 0.05)

## Outputs

- massdiff object with Bonferroni-corrected Significance field (boolean)
- p-value threshold after correction (α / number of tests)
- subset of ion pairs meeting corrected significance

## How to apply

After computing raw p-values for each pairwise correlation test (e.g., via corrPairsMSI()), apply Bonferroni correction by dividing the significance threshold (typically α = 0.05) by the total number of tests performed. A result is considered significant if its raw p-value is less than α / (number of tests). The mass2adduct package applies this correction automatically in corrPairsMSI(), returning a boolean Significance field that indicates whether each ion pair meets the Bonferroni-corrected threshold. Report both raw p-values and the corrected significance status in results to allow downstream filtering and interpretation.

## Related tools

- **corrPairsMSI** (Computes two-tailed Pearson correlation tests for each ion pair and automatically applies Bonferroni correction to output significance field) — https://github.com/kbseah/mass2adduct
- **corrPairsMSIchunks** (Memory-efficient variant of corrPairsMSI for large datasets; also applies Bonferroni correction to output) — https://github.com/kbseah/mass2adduct
- **mass2adduct (R package)** (Host package providing corrPairsMSI and corrPairsMSIchunks functions with built-in Bonferroni correction) — https://github.com/kbseah/mass2adduct

## Examples

```
d.diff.annot.cor <- corrPairsMSI(d, d.diff.annot); # Returns massdiff object with raw P.value and Bonferroni-corrected Significance fields
```

## Evaluation signals

- Corrected significance threshold = α / (total number of ion pairs tested). Verify this calculation matches the reported threshold.
- All Significance boolean values in output massdiff object should be FALSE for raw p-values ≥ corrected threshold; TRUE only for raw p-values < corrected threshold.
- Raw p-values and corrected Significance field should both be present in output, allowing manual verification of correction logic.
- The number of significant ion pairs after correction should be substantially lower than before correction, reflecting the stringency of family-wise error control.
- Bonferroni-corrected results should be reproducible: identical inputs and parameters must yield identical Significance assignments across runs.

## Limitations

- Bonferroni correction is conservative, especially when the number of tests is large (thousands or more), and may fail to detect true signals.
- The correction assumes independence between tests; ion-pair correlations in MSI data may violate this assumption, leading to over-correction.
- For very large datasets (hundreds of thousands of ion pairs), the corrected significance threshold becomes extremely stringent, potentially yielding zero or very few significant results.
- The package applies Bonferroni correction at default α = 0.05 by default; custom thresholds may require manual adjustment of results post-hoc.

## Evidence

- [other] This performs a correlation test (by default two-tailed with Pearson's method) on each pair of peaks in the massdiff object.: "This performs a correlation test (by default two-tailed with Pearson's method) on each pair of peaks in the massdiff object."
- [other] Extract and report correlation Estimate, raw P.value, and Bonferroni-corrected Significance (boolean) fields in the output massdiff object.: "Extract and report correlation Estimate, raw P.value, and Bonferroni-corrected Significance (boolean) fields in the output massdiff object."
- [readme] By default the cutoff for significance is p=0.05 with Bonferroni correction.: "By default the cutoff for significance is p=0.05 with Bonferroni correction."
- [readme] Output is a data.frame with p-values for each ion pair. By default the cutoff for significance is p=0.05 with Bonferroni correction.: "Output is a data.frame with p-values for each ion pair. By default the cutoff for significance is p=0.05 with Bonferroni correction."

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.