agentsclimarketplace

Group wise chemical enrichment calculation

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/ce-ms/skills/group-wise-chemical-enrichment-calculation

Use when when comparing GNPS chemical annotations across two or more groups of samples (defined by ReDU sample-information categories such as sample type, extraction method, or ionization source) where the groups contain different numbers of files.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill group-wise-chemical-enrichment-calculation

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

8.4 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

group-wise-chemical-enrichment-calculation

Summary

Normalize chemical annotation prevalence across sample groups with unequal file counts by computing per-group enrichment percentages, enabling fair comparative analysis of metabolite distribution in public mass spectrometry repositories.

When to use

When comparing GNPS chemical annotations across two or more groups of samples (defined by ReDU sample-information categories such as sample type, extraction method, or ionization source) where the groups contain different numbers of files. Enrichment percentages are required to make valid statistical comparisons when group sizes are imbalanced.

When NOT to use

  • Input groups have already been normalized or enrichment percentages have already been computed from the same chemical annotation set.
  • Sample-information categories are unknown or missing; the ReDU template has not been completed and validated.
  • GNPS annotations have not been performed or chemical identifications are absent from the dataset.

Inputs

  • ReDU sample-information template (TSV format)
  • GNPS chemical annotations for all samples
  • Sample grouping category (string: sample type, extraction method, ionization source, etc.)

Outputs

  • Chemical enrichment table (rows=chemicals, columns=groups, values=enrichment percentages)
  • Validated enrichment percentages within [0, 100] range
  • Group size metadata for normalization verification

How to apply

Load the ReDU sample-information template (TSV format) and the corresponding GNPS chemical annotations for all samples. Group samples by the selected sample-information category. For each group and each unique chemical (GNPS annotation), count how many samples in that group contain the chemical, then compute enrichment as (count of samples in group containing chemical) / (total samples in group) × 100. Tabulate results with rows as chemical compounds and columns as groups, with enrichment percentage in each cell. Validation is essential: row sums and group totals must match the source annotation data, and all percentages must fall within [0, 100]. This normalization method accounts for group-size imbalance and enables reliable downstream visualization (e.g., PCA score plots in Emperor) and statistical comparisons.

Related tools

Evaluation signals

  • All enrichment percentages lie strictly within [0, 100]
  • For each group, the sum of samples counted across all chemicals matches (total samples in group) × (number of unique chemicals), accounting for chemicals absent in some samples
  • Row sums (total group membership across chemicals) and column sums (total chemical prevalence across groups) match source annotation counts
  • Groups with different numbers of files now produce comparable enrichment values (e.g., a chemical present in 50% of samples in group A and 50% of samples in group B both yield 50%, regardless of group size)
  • Downstream visualization (e.g., Emperor PCA) shows unbiased clustering patterns not driven by group-size artifacts

Limitations

  • The same chemical can have multiple GNPS annotations due to slight variation in MS2 spectra (m/z or abundance); manual or computational deduplication may be needed before enrichment calculation to avoid inflated chemical counts.
  • Enrichment percentages do not account for spectral quality, annotation confidence scores, or the distinction between level 2 (putative annotation based on spectral library similarity) and level 3 (putatively characterized compound class) annotations; filtering by confidence threshold should be performed upstream.
  • Sample-information template completion is manual and prone to missing or inconsistent entries; validation using the ReDU drag-and-drop validator is essential before enrichment calculation.

Evidence

  • [other] Percentages should be used to tabulate sample information enrichment for each chemical annotated across groups, enabling fair comparison when groups contain different file counts.: "Percentages should be used to tabulate sample information enrichment for each chemical annotated across groups, enabling fair comparison when groups contain different file counts."
  • [other] For each group, enumerate the unique chemicals (GNPS annotations) present across all samples in that group and count the number of samples within the group containing each chemical. Compute enrichment as (count of samples in group containing chemical) / (total samples in group) × 100 to yield percentage, normalizing for group-size imbalance.: "For each group, enumerate the unique chemicals (GNPS annotations) present across all samples in that group and count the number of samples within the group containing each chemical. Compute"
  • [other] Tabulate results with rows as chemicals and columns as groups, displaying enrichment percentage in each cell. Validate that row sums and group totals match the source annotation data and that all percentages fall within [0, 100].: "Tabulate results with rows as chemicals and columns as groups, displaying enrichment percentage in each cell. Validate that row sums and group totals match the source annotation data and that all"
  • [other] Load the ReDU sample-information template (TSV format) and associated GNPS chemical annotations for all samples, grouping by the sample-information category selected (e.g., sample type, extraction method, ionization source).: "Load the ReDU sample-information template (TSV format) and associated GNPS chemical annotations for all samples, grouping by the sample-information category selected"
  • [abstract] The same chemical can have multiple GNPS annotations. Slight variation in the MS2 spectra (m/z or abundance) cause the pattern to match different reference MS2 spectra for the same chemical: "The same chemical can have multiple GNPS annotations. Slight variation in the MS2 spectra (m/z or abundance) cause the pattern to match different reference MS2 spectra"
  • [abstract] Chemical annotations originating from spectral library matching are considered level 2 or level 3 by the 2007 metabolomics standard initiative: "GNPS annotations via spectral reference matching are considered level 2 (putative annotation based on spectral library similarity) or level 3"

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.