agentsclimarketplace

Batch effect correction and adjustment

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/batch-effect-correction-and-adjustment

Use when your m/z peak data spans multiple batches (recorded in metadata as a batch ID column) or samples have varying concentrations that are documented in metadata.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill batch-effect-correction-and-adjustment

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.4 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

batch-effect-correction-and-adjustment

Summary

Correct systematic variations in m/z peak intensities that arise from processing samples across different batches or with varying sample concentrations. This skill removes batch-related confounding effects to enable fair cross-batch and cross-sample comparison in mass spectrometry metabolomics workflows.

When to use

Your m/z peak data spans multiple batches (recorded in metadata as a batch ID column) or samples have varying concentrations that are documented in metadata. Apply this skill before filtering and normalization if batch effects or concentration differences could bias downstream statistical comparisons or compound identification.

When NOT to use

  • Metadata contains only one batch and no concentration information — skip batch correction and proceed directly to filtering and normalization.
  • Peak data has already been batch-corrected by upstream preprocessing (e.g., XCMS already applied batch correction) — applying a second correction may introduce artifact.
  • Batch IDs or concentration columns are missing or incompletely populated in metadata — the correction step will fail or produce unreliable results.

Inputs

  • m/z peak data table (positive and/or negative ionization mode, from XCMS/MetaboAnalyst or native MetaboShiny format)
  • Metadata file with 'sample' column (matching peak table sample names), 'individual' column, and optional 'batch' and 'concentration' columns

Outputs

  • Batch-corrected and concentration-normalized m/z peak intensity table
  • Feature table ready for subsequent filtering and normalization steps

How to apply

Load your m/z peak data (e.g., from XCMS or MetaboAnalyst export format) and corresponding metadata file containing batch IDs and/or sample concentration values into MetaboShiny. Click 'Get options' in the Batches and concentration panel. Select the metadata column representing concentration (if applicable) and the column containing batch IDs (if applicable). The tool will apply batch correction to account for systematic variations across batches, then normalize peak intensities by the selected concentration factor. The corrected data accounts for both inter-batch drift and sample loading differences, enabling proper intensity comparisons in subsequent filtering and normalization steps.

Related tools

  • MetaboShiny (Interactive R Shiny application that implements batch correction and concentration normalization for m/z peak data via the Batches and concentration panel) — https://github.com/joannawolthuis/MetaboShiny
  • R (Underlying language for MetaboShiny; batch correction computations and metadata processing are executed in R)
  • XCMS (Upstream preprocessing tool for peak detection and alignment; outputs peak tables that serve as input to batch correction)

Evaluation signals

  • Batch-corrected peak intensity distributions are visually similar across batches in pre/post-normalization plots generated by MetaboShiny.
  • Peak intensities are scaled proportionally to sample concentration values — samples with higher concentration have proportionally higher intensity after correction.
  • Concentration-normalized feature table shows reduced variance attributable to batch ID in subsequent PCA or statistical tests.
  • Output feature table is non-null and contains the same m/z features as input, with adjusted intensity values.
  • Metadata batch and concentration columns are successfully parsed without error (verified by 'Get options' button completion).

Limitations

  • Requires explicit batch ID and/or concentration metadata columns; batch correction cannot be inferred from peak intensity patterns alone.
  • Assumes batch effects are systematic and removable; if batch effects are confounded with biological signal of interest, correction may remove genuine signal.
  • Concentration column must be numeric and represent true sample loading differences; if concentration values are unreliable or missing for many samples, correction accuracy is compromised.
  • Does not address batch effects introduced during metabolite identification or database searching; only corrects raw peak intensity data.

Evidence

  • [other] MetaboShiny provides data normalization functionality organized into two components: one for handling batches and concentration, and a separate module for filtering and normalization operations on loaded m/z peak data.: "MetaboShiny provides data normalization functionality organized into two components: one for handling batches and concentration, and a separate module for filtering and normalization"
  • [other] Apply batch correction to account for systematic variations across sample batches. Normalize peak intensities by concentration to account for differences in sample loading.: "Apply batch correction to account for systematic variations across sample batches. Normalize peak intensities by concentration to account for differences in sample loading."
  • [readme] If your metadata only contains one batch and no column that represents concentration, then you can skip this part and continue to the Filtering and normalization step.: "If your metadata only contains one batch and no column that represents concentration, then you can skip this part and continue"
  • [readme] MetaboShiny, unless using the MetaboAnalyst format, requires an additional metadata table. This should minimally have a 'sample' column that contains the same sample identifiers used in the peak table files, an 'individual' column (since multiple samples can come from one individual in time series data) and at least one column on experimental group or something alike.: "metadata table. This should minimally have a 'sample' column that contains the same sample identifiers used in the peak table files, an 'individual' column and at least one column on experimental"
  • [readme] Click on the 'Get options' button. If applicable, select the variable that represents concentration in your data. If applicable, select the variable that contains your multiple batch IDs.: "Click on the 'Get options' button. If applicable, select the variable that represents concentration in your data. If applicable, select the variable that contains your multiple batch IDs."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.