Motif pseudo spectra optimization filtering
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill motif-pseudo-spectra-optimization-filteringAssembled 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 author says it does
Copied from the file, not written here
Use when after LDA has converged and inferred Mass2Motifs from preprocessed mass spectrometry spectral data, when the raw motif-fragment distributions contain noise or low-confidence associations that obscure the dominant fragmentation patterns.
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.0 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
motif-pseudo-spectra-optimization-filtering
Summary
Filter and optimize inferred Mass2Motifs (topic-fragment probability distributions) by removing low-probability fragments and neutral losses according to configurable probability thresholds, producing a refined set of interpretable pseudo-spectra suitable for annotation and comparison against reference motif databases.
When to use
After LDA has converged and inferred Mass2Motifs from preprocessed mass spectrometry spectral data, when the raw motif-fragment distributions contain noise or low-confidence associations that obscure the dominant fragmentation patterns. Use this skill when you need to generate clean pseudo-spectra representations that emphasize the most probable fragments and losses for each motif before downstream annotation or motif database comparison.
When NOT to use
- The raw LDA motif distributions have not yet converged or likelihood tracking shows ongoing volatility — apply convergence diagnostics first.
- You require per-motif Bayesian posterior credible intervals rather than point-estimate filtering; use proper uncertainty quantification instead.
- The goal is exploratory discovery of ALL fragmentation associations, including rare ones; aggressive thresholding may discard rare but genuine motifs.
Inputs
- Converged LDA model state (fitted topic-fragment probability matrix and fragment-loss distributions)
- Inferred Mass2Motifs (topic-to-fragment and topic-to-neutral-loss probability distributions)
- Probability threshold parameter (configurable cutoff value, typically 0.01–0.10)
Outputs
- Optimized Mass2Motif set (filtered pseudo-spectra with low-probability fragments/losses removed)
- Mass2Motif JSON serialization (annotated with fragment masses, losses, and retained probabilities)
- Motif cardinality and coverage metrics (number of fragments/losses per motif post-filtering)
How to apply
Extract the inferred Mass2Motifs (topic-fragment probability distributions and fragment-loss distributions over topics) from the converged LDA model. Apply configurable probability thresholds to filter fragments and neutral losses below a specified cutoff; this threshold selection should balance specificity (keeping only high-confidence fragments) against sensitivity (retaining motifs with sufficient discriminatory power). Iteratively evaluate threshold values by inspecting the resulting motif cardinality and comparing pseudo-spectra to known reference entries in MotifDB or via annotation tools like MAG+Spec2Vec. Serialize the optimized motif set to JSON format for downstream visualization and validation. The rationale is that topic models infer sparse but noisy distributions; probability thresholding concentrates the motif representation on the most plausible fragmentation signatures, improving interpretability and reducing false-positive structural inferences.
Related tools
- MS2LDA (LDA modeling framework that infers Mass2Motifs; this skill refines its output motif distributions post-convergence) — https://github.com/vdhooftcompmet/MS2LDA
- MotifDB (Reference database of known Mass2Motifs; used to validate and annotate optimized pseudo-spectra) — https://zenodo.org/records/15688609
- MAG (Automated Mass2Motif Annotation Guidance) (Automated annotation tool that interprets optimized motifs by comparison to MotifDB and structural databases)
- Spec2Vec (Spectral embedding and similarity metric used by MAG to match optimized pseudo-spectra against reference motifs)
- Python (Programming environment for threshold configuration and JSON serialization of optimized motifs)
Evaluation signals
- Motif pseudo-spectra cardinality post-filtering is reduced compared to raw LDA output (fewer low-probability fragments retained), confirming threshold application.
- Optimized Mass2Motif JSON schema validates: each motif contains fragment/loss entries with non-zero probabilities above the chosen threshold.
- Filtered pseudo-spectra show improved cosine similarity or Spec2Vec alignment with reference MotifDB entries, indicating sharper motif signatures.
- Manual inspection of a subset of optimized motifs confirms that retained fragments are chemically plausible (e.g., common losses, known neutral eliminations) and noise (singleton or random high-mass fragments) is removed.
- Motif coverage (total % of spectral intensity explained by optimized motifs) does not drop significantly after filtering, indicating that thresholding removed noise rather than true signal.
Limitations
- Probability threshold selection is empirically driven and data-dependent; no universal optimal threshold is provided in the article. Requires iterative validation or comparison to a curated reference set.
- Filtering may discard rare but genuine motifs if thresholds are set too aggressively; balance between specificity and sensitivity must be determined case-by-case.
- Filtered pseudo-spectra are context-dependent on the input spectral corpus and LDA hyperparameters; the same motif may have different cardinality across experiments with different sample distributions.
- No explicit guidance is provided on whether to filter fragment distributions and neutral-loss distributions with the same threshold; asymmetric thresholding may be needed for different ion modes.
Evidence
- [other] Extract inferred Mass2Motifs (topic-fragment probability distributions) and document-motif loadings: "Extract inferred Mass2Motifs (topic-fragment probability distributions) and document-motif loadings, then serialize to JSON format."
- [other] Optimize motif pseudo-spectra by filtering low-probability fragments and losses: "Optimize motif pseudo-spectra by filtering low-probability fragments and losses according to probability thresholds, producing the optimized Mass2Motif set."
- [other] MS2LDA applies LDA to learn topic distributions over fragments/losses: "Apply Latent Dirichlet Allocation via the MS2LDA modeling module to learn topic distributions over fragments/losses and fragment/loss distributions over topics across the full spectral dataset."
- [methods] Compare motifs to known entries in MotifDB: "Compare motifs to known entries in MotifDB"
- [methods] Automated annotation of M2M using MAG: "Automated Mass2Motif Annotation Guidance (MAG) with Spec2Vec"
- [readme] Topic modeling applied to MS/MS fragmentation patterns: "MS2LDA uses Latent Dirichlet Allocation (LDA) to infer which motifs are most likely to explain the observed fragmentation patterns."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.