agentsclimarketplace

Batch effect correction workflow

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/batch-effect-correction-workflow

Use when you have a feature table generated from LC-MS/MS non-targeted metabolomics data that spans multiple sample preparation batches, instrumental runs, or experimental conditions.From its SKILL.md

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

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

  • 14 stars14 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

6.6 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

batch-effect-correction-workflow

Summary

Batch effect correction is a preprocessing step applied to non-targeted LC-MS/MS metabolomics feature tables to remove systematic variation introduced by instrumental or experimental batch conditions before multivariate statistical analysis. Correcting batch effects ensures that observed patterns in downstream analyses reflect true biological differences rather than technical artifacts.

When to use

Apply this skill when you have a feature table generated from LC-MS/MS non-targeted metabolomics data that spans multiple sample preparation batches, instrumental runs, or experimental conditions. Use it after data merging, data cleanup, and blank removal, and before univariate or multivariate statistical analysis. Batch correction is particularly critical when comparing samples across multiple MassIVE datasets or when instrumental drift or batch-specific systematic noise is suspected.

When NOT to use

  • If your data derives from a single instrumental batch or experimental run with no known batch effects, batch correction may introduce artifacts rather than remove them.
  • If batch structure is confounded with treatment/phenotype (e.g., all treatment samples in batch 1, all controls in batch 2), batch correction risks removing true biological signal.
  • If input data have not yet undergone data cleanup, blank removal, or merging—apply those preprocessing steps first.

Inputs

  • Feature table (intensity matrix with features as rows, samples as columns)
  • Sample metadata file with batch assignment information
  • Blank-removed and cleaned feature abundance matrix

Outputs

  • Batch-corrected feature table (same dimensions as input, with batch effects removed)
  • Batch effect diagnostics and visualization (e.g., PCA before/after correction)
  • Correction parameters and model metadata for reproducibility

How to apply

Load the merged, cleaned, and blank-removed feature table into the FBMN-STATS Jupyter Notebook environment (R or Python). Apply batch correction algorithms available in the notebook—typically combat or similar variance-stabilizing methods—which model and remove batch-specific effects while preserving biological signal. The notebook parameterizes the batch variable based on sample metadata (e.g., run date, instrument ID, or explicit batch assignment). After correction, verify that principal component analysis (PCA) plots no longer show clustering by batch, and that the corrected feature abundance distributions are statistically comparable across batches before proceeding to univariate and multivariate statistical analyses.

Related tools

Evaluation signals

  • PCA plots before and after correction show no clear clustering by batch variable; biological/phenotypic clustering is preserved or enhanced.
  • Feature abundance distributions are comparable across batches post-correction; variance is not driven by batch membership.
  • Output feature table has identical dimensions to input; all features and samples are retained (no rows or columns dropped).
  • Batch correction parameters (e.g., batch means, shrinkage estimates) are saved and reproducible when re-running the notebook.
  • Downstream multivariate statistical results (e.g., principal component loadings, discriminant analysis scores) are not dominated by batch artifacts.

Limitations

  • Batch correction assumes that batch effects are additive or multiplicative across features; non-linear batch patterns may not be fully corrected.
  • If batch structure is strongly confounded with true biological treatment, correction may inadvertently remove treatment signal.
  • Colab environment automatically disconnects after 90 minutes of idleness or 12 continuous hours of use, requiring re-running the entire batch correction workflow.
  • Disk space in Google Colab is limited to 77 GB; correction of very large metabolomics datasets (multiple GB feature tables) may exhaust storage.
  • Batch metadata must be accurately recorded and provided; missing or mislabeled batch information will compromise correction quality.

Evidence

  • [readme] perform data merging, data cleanup, blank removal, batch correction, and univariate and multivariate statistical analyses on their non-targeted LC-MS/MS data: "perform data merging, data cleanup, blank removal, batch correction, and univariate and multivariate statistical analyses on their non-targeted LC-MS/MS data"
  • [other] Statistical analysis methods can be applied to feature-based molecular networks from non-targeted LC-MS/MS metabolomics data: "Statistical analysis methods can be applied to feature-based molecular networks from non-targeted LC-MS/MS metabolomics data"
  • [other] The notebooks provided here enable multivariate statistical analysis of non-targeted LC-MS/MS data: "The FBMN-STATS repository contains Jupyter notebooks that enable multivariate statistical analysis"

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 326,835. 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.