agentsclimarketplace

Negative adduct tokenization in mass spectrometry

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/negative-adduct-tokenization-in-mass-spectrometry

Use when you have negative-mode MS/MS spectra with annotated molecular formulas and negative adducts (from repositories like MassIVE or MetaboLights), and your current formula inference model is restricted to positive mode only.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill negative-adduct-tokenization-in-mass-spectrometry

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.7 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

negative-adduct-tokenization-in-mass-spectrometry

Summary

Extend formula transformer neural networks to recognize and tokenize negative ionization mode adducts ([M-H]−, [M+Cl]−, [M+FA]−) in tandem mass spectra, enabling chemical formula ranking for negative-mode MS/MS data. This skill adapts the MIST-CF architecture from positive-mode-only operation to support dual-polarity metabolite identification.

When to use

You have negative-mode MS/MS spectra with annotated molecular formulas and negative adducts (from repositories like MassIVE or MetaboLights), and your current formula inference model is restricted to positive mode only. Use this skill when you need to extend an existing formula transformer to handle [M-H]−, [M+Cl]−, or [M+FA]− ions and rank candidate formulas by top-k accuracy on held-out negative-mode test spectra.

When NOT to use

  • Your input spectra are exclusively positive ionization mode or contain no adduct annotations—use the original positive-mode MIST-CF instead.
  • Your negative-mode dataset is too small (<1000 spectra) to support fine-tuning without overfitting; consider data augmentation or transfer learning from positive mode first.
  • You require real-time inference on new spectra without a labeled negative-mode test set for validation; train and evaluate on the same dataset will not yield reliable accuracy estimates.

Inputs

  • negative-mode MS/MS spectra (MGF or raw format)
  • precursor m/z values with annotated molecular formulas
  • negative adduct type annotations ([M-H]−, [M+Cl]−, [M+FA]−)
  • pre-trained MIST-CF model weights (positive mode)
  • sinusoidal formula embeddings from SCARF

Outputs

  • extended MIST-CF model with negative-mode adduct tokenization layer
  • fine-tuned formula transformer weights for negative ionization
  • top-1, top-5, top-10 formula ranking accuracy metrics per negative adduct type
  • comparative metrics table across negative adducts

How to apply

First, acquire negative-mode MS/MS spectra from public metabolomics repositories with annotated molecular formulas and negative adducts. Preprocess spectra by normalizing intensity and removing noise below a defined threshold. Extend the adduct tokenization layer in the MIST-CF architecture to include common negative-mode adducts ([M-H]−, [M+Cl]−, [M+FA]−), treating each adduct type as a discrete token similar to the existing positive-mode tokens. Fine-tune the formula transformer neural network using negative-mode spectra while maintaining the existing sinusoidal formula embeddings from SCARF to preserve learned chemical space structure. Evaluate the fine-tuned model on a held-out negative-mode test set by computing top-1, top-5, and top-10 formula ranking accuracy across each negative adduct type, and compile results in a metrics table to identify any performance asymmetries across adduct classes.

Related tools

Examples

. run_scripts/public_data_train/train_mist_cf.sh

Evaluation signals

  • Top-1, top-5, and top-10 formula ranking accuracy on held-out negative-mode test set all improve relative to positive-mode baseline
  • Performance is consistent across the three main negative adduct types ([M-H]−, [M+Cl]−, [M+FA]−); large variance between adducts suggests incomplete tokenization or insufficient training data for rare adducts
  • Sinusoidal formula embeddings remain stable (L2 norm difference < 1% from SCARF pre-training) after fine-tuning, confirming knowledge preservation
  • Adduct token logits in the output layer show clear separation between negative and positive adduct classes (e.g., via t-SNE or cosine similarity clustering)
  • No significant overfitting: test accuracy gap relative to training accuracy is < 5 percentage points across all top-k metrics

Limitations

  • MIST-CF currently supports only positive ionization mode; extension to negative mode has not yet been benchmarked against competing tools like SIRIUS on negative-mode datasets.
  • Fine-tuning may suffer from data scarcity if negative-mode spectra are underrepresented in available public repositories (e.g., MassIVE, MetaboLights).
  • Sinusoidal formula embeddings from SCARF were learned on positive-mode chemical space; transfer to negative mode may introduce bias toward positive-mode ion fragmentation patterns.
  • Adduct tokenization assumes discrete adduct types; complex or instrument-specific adducts not in the predefined set ([M-H]−, [M+Cl]−, [M+FA]−) will not be recognized.
  • Evaluation is limited to top-k accuracy metrics; other desiderata (e.g., calibration, false positive rate on out-of-database formulas) are not addressed in the task specification.

Evidence

  • [other] MIST-CF currently considers multiple adduct types beyond [M+H]+ but is still restricted to positive mode only.: "MIST-CF currently considers multiple adduct types beyond [M+H]+ but is still restricted to positive mode only."
  • [other] Extend the adduct tokenization layer in MIST-CF to include common negative-mode adducts ([M-H]−, [M+Cl]−, [M+FA]−).: "Extend the adduct tokenization layer in MIST-CF to include common negative-mode adducts ([M-H]−, [M+Cl]−, [M+FA]−)."
  • [other] Fine-tune the formula transformer neural network using negative-mode spectra, maintaining the existing sinusoidal formula embeddings from SCARF.: "Fine-tune the formula transformer neural network using negative-mode spectra, maintaining the existing sinusoidal formula embeddings from SCARF."
  • [other] Evaluate the fine-tuned model on a held-out negative-mode test set by computing top-1, top-5, and top-10 formula ranking accuracy.: "Evaluate the fine-tuned model on a held-out negative-mode test set by computing top-1, top-5, and top-10 formula ranking accuracy."
  • [intro] Considering multiple adduct types beyond [M+H]+ (still only positive mode): "Considering multiple adduct types beyond [M+H]+ (still only positive mode)"
  • [intro] Instead of computing fragmentation trees, MIST-CF adopts a formula transformer neural network architecture and learns in a data dependent fashion: "Instead of computing fragmentation trees, MIST-CF adopts a formula transformer neural network architecture and learns in a data dependent fashion"

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.