[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EE5Z1X3HQ8ECY8DC0GNTCH":3,"skill-same:01M7EE5Z1X3HQ8ECY8DC0GNTCH":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EE5Z1X3HQ8ECY8DC0GNTCH","bio-metabolomics-metabolite-annotation",null,"Turns untargeted LC-MS\u002FMS features (m\u002Fz, RT, MS\u002FMS) into confidence-stratified metabolite annotations using spectral-library matching (matchms), in-silico tools (SIRIUS\u002FCSI:FingerID, MetFrag) and molecular networking, and assigns a defensible MSI\u002FSchymanski confidence level to each. Use when naming detected features, scoring MS\u002FMS against a reference library, running SIRIUS, or deciding what confidence level an evidence set actually supports. For upstream feature extraction see metabolomics\u002Fxcms-preprocessing and metabolomics\u002Fmsdial-preprocessing; for downstream enrichment that must respect these levels see metabolomics\u002Fpathway-mapping; for lipid-specific structural annotation see metabolomics\u002Flipidomics.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-metabolomics-metabolite-annotation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-metabolomics-metabolite-annotation\ndescription: Turns untargeted LC-MS\u002FMS features (m\u002Fz, RT, MS\u002FMS) into confidence-stratified metabolite annotations using spectral-library matching (matchms), in-silico tools (SIRIUS\u002FCSI:FingerID, MetFrag) and molecular networking, and assigns a defensible MSI\u002FSchymanski confidence level to each. Use when naming detected features, scoring MS\u002FMS against a reference library, running SIRIUS, or deciding what confidence level an evidence set actually supports. For upstream feature extraction see metabolomics\u002Fxcms-preprocessing and metabolomics\u002Fmsdial-preprocessing; for downstream enrichment that must respect these levels see metabolomics\u002Fpathway-mapping; for lipid-specific structural annotation see metabolomics\u002Flipidomics.\ntool_type: mixed\nprimary_tool: matchms\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"metabolomics\u002Fmetabolite-annotation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: matchms 0.33+, SIRIUS 6.x, MetFrag 2.5+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nSpectral matching needs precursor m\u002Fz on every MS\u002FMS spectrum (`add_precursor_mz` filter) or ModifiedCosine silently returns zeros. Level 1 needs an authentic standard run in the same lab under the same method; no software output can substitute for it.\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Metabolite Annotation\n\n**\"Annotate my metabolomics features with compound identities\"** -> Map each feature's m\u002Fz and MS\u002FMS to candidate structures, then attach an explicit confidence level to every name.\n- Python: `matchms.calculate_scores()` for library matching (matchms)\n- CLI: `sirius ... formulas fingerprints structures canopus` for in-silico formula\u002Fstructure\u002Fclass (SIRIUS)\n\n## The Single Most Important Insight -- An Annotation Is a Hypothesis Carrying a Confidence Level, Not an Identification\n\nA metabolite name without a stated MSI\u002FSchymanski level is scientifically incomplete. The inference chain m\u002Fz -> formula -> structure -> isomer-resolved identity is three separate lossy steps, each needing its own orthogonal evidence axis. A database hit supplies a name, not evidence: with no MS\u002FMS or RT to back it, it is Schymanski Level 4 (formula) at best, often Level 5 (a feature of interest). A high cosine score ranks candidates; it never proves one. Only an in-house authentic standard, same method, with MS, MS\u002FMS, and RT all matching reaches Level 1 (\"identification\") -- everything else is an honest hypothesis. The field's recurring sin is laundering Level 2\u002F3 hypotheses into Level-1 prose; the canonical worked example is phenylacetylglutamine being reported as phenylacetylglycine in nearly half of NMR studies (Theodoridis 2023). Assign the lowest level the evidence honestly supports and report which database\u002Fversion was searched.\n\n## Confidence-Level Taxonomy (MSI and Schymanski)\n\n| Schymanski | MSI | Name | Evidence required |\n|---|---|---|---|\n| Level 1 | 1 | Confirmed structure | In-house authentic standard, same method: MS + MS\u002FMS + RT all match. The only \"identification\". |\n| Level 2a | 2 | Probable structure (library) | MS\u002FMS matches a reference library spectrum; no in-house standard. |\n| Level 2b | 2 | Probable structure (diagnostic) | Diagnostic fragments \u002F RT \u002F ionization consistent with exactly one structure; no reference spectrum. |\n| Level 3 | 3 | Tentative candidate(s) | Evidence narrows to a structure class or candidate set but isomers remain unresolved. |\n| Level 4 | -- | Unequivocal formula | MS1 accurate mass + isotope pattern + adduct logic assign one formula; no structure. |\n| Level 5 | 4 | Exact mass | A feature of interest; nothing assigned. |\n\nPromote one level per orthogonal evidence axis that survives scrutiny; cap at Level 2 unless an in-house standard exists. CSI:FingerID and library matching recover constitution only -- no stereochemistry, so enantiomer\u002Fregiochemistry claims cannot come from MS\u002FMS.\n\n## Tool Roles\n\n| Tool | Core idea | Output | Best for |\n|---|---|---|---|\n| matchms (CosineGreedy \u002F ModifiedCosine \u002F spectral entropy) | Score query MS\u002FMS against library spectra | Ranked library hits + matched-peak count | Level 2a when a library spectrum exists |\n| SIRIUS + ZODIAC | Fragmentation trees + isotope pattern, dataset-wide formula re-ranking | Ranked molecular formula | Formula (Level 4); the reliable part of SIRIUS |\n| CSI:FingerID + COSMIC | Predict fingerprint, search structure DB, calibrated confidence | Ranked structures + FDR-controllable score | Level 2b\u002F3 structure when COSMIC FDR is set |\n| CANOPUS | Predict compound class directly from MS2 | ClassyFire + NPClassifier class | Level 3 class for unknowns; often the most honest output |\n| MetFrag | Bond-disconnection scoring of candidate list | Explainable fragment-supported ranks | Transparent, scriptable, custom DBs, RT term |\n| FBMN (GNPS2) + MS2Query | Modified-cosine network \u002F ML analogue search | Edges = \"related to\" | Analogue propagation (Level 3 scaffold hypothesis) |\n\n## Decision Tree: Evidence Available -> Tool -> Achievable Level\n\n| Situation | Do | Achievable level |\n|---|---|---|\n| In-house authentic standard, same method, MS+MS\u002FMS+RT match | Confirm against standard | Level 1 |\n| MS\u002FMS available, library spectrum likely exists | matchms library match (entropy or modified cosine) | Level 2a |\n| MS\u002FMS available, no library spectrum | SIRIUS formulas + CSI:FingerID + CANOPUS, or MetFrag | Level 2b\u002F3 (formula Level 4) |\n| Need class only \u002F compound absent from all DBs | CANOPUS (class); MSNovelist (de novo SMILES) | Level 3 |\n| Find analogues \u002F propagate across a network | FBMN on GNPS2 + MS2Query | Level 3 (scaffold hypothesis) |\n| Only MS1 m\u002Fz + isotopes + clean adduct | Formula assignment (SIRIUS \u002F seven golden rules) | Level 4 |\n| Bare m\u002Fz, no orthogonal evidence | Report as a feature | Level 5 |\n| Biology hinges on a specific isomer \u002F stereocenter | Demand a standard or orthogonal method (NMR, chiral assay) | MS alone insufficient |\n\n## Match MS\u002FMS Against a Spectral Library\n\n**Goal:** Rank library candidates for each query spectrum and attach the matched-peak count, not just the score.\n\n**Approach:** Harmonize metadata, normalize intensities, add precursor m\u002Fz, score with ModifiedCosine (analogue-aware) or spectral entropy (identity), then keep only hits above both a score and a matched-peak floor.\n\n```python\nfrom matchms import calculate_scores\nfrom matchms.filtering import default_filters, normalize_intensities, add_precursor_mz\ntry:\n    from matchms.similarity import ModifiedCosineGreedy as ModifiedCosine  # matchms 0.33+\nexcept ImportError:\n    from matchms.similarity import ModifiedCosine          # matchms \u003C= 0.32\n\ndef prepare(spectrum):\n    spectrum = default_filters(spectrum)\n    spectrum = add_precursor_mz(spectrum)  # required for ModifiedCosine or scores are zero\n    return normalize_intensities(spectrum)\n\nqueries = [prepare(s) for s in queries_raw]\nreferences = [prepare(s) for s in references_raw]\n\nscores = calculate_scores(references, queries, ModifiedCosine(tolerance=0.005))\n\n# CosineGreedy\u002FModifiedCosine return a structured array; the field names are\n# class-prefixed and version-dependent (e.g. 'ModifiedCosineGreedy_score' in 0.33),\n# so derive them from the dtype rather than hard-coding.\nfor query in queries:\n    pairs = scores.scores_by_query(query)\n    score_field, match_field = pairs[0][1].dtype.names\n    ref, hit = max(pairs, key=lambda pair: pair[1][score_field])\n    if hit[score_field] >= 0.7 and hit[match_field] >= 6:  # score floor + peak-count floor (GNPS defaults)\n        print(ref.get('compound_name'), hit[score_field], hit[match_field])  # Level 2a candidate\n```\n\n## Run SIRIUS for Formula, Structure, and Class\n\n**Goal:** Annotate features that have no library spectrum, reporting formula and class with more trust than top-1 structure.\n\n**Approach:** Run the SIRIUS subcommand chain on one project space; trust ZODIAC-refined formula over CSI:FingerID structure, and only report a structure as confident when a COSMIC FDR threshold is set.\n\n```bash\n# SIRIUS 6 is a multi-command pipeline on one line. A free academic account\u002Flicense\n# is required (since v5); log in once, then the project space persists across runs.\n# Credential flags vary by version; run `sirius login --help` to confirm (commonly `-u \u003Cemail>`).\nsirius login -u \"$SIRIUS_USER\"\n\nsirius --input features.mgf --project .\u002Fsirius_project \\\n    formulas --profile orbitrap \\\n    fingerprints \\\n    structures --database bio \\\n    canopus \\\n    write-summaries --output .\u002Fsirius_summary\n# Verify exact subcommand spelling with `sirius \u003Ccommand> --help`: formulas\u002Ffingerprints\u002F\n# structures\u002Fcanopus changed plural\u002Fsingular and options between v5 and v6.\n# --database (on structures) is a scientific choice: 'bio' raises plausibility but cannot\n# return a novel metabolite; 'pubchem' maximizes recall but floods implausible isomers.\n```\n\n## Assemble an Evidence-to-Level Call\n\n**Goal:** Collapse a feature's evidence set into a single defensible confidence level.\n\n**Approach:** Start at Level 5 and promote per surviving orthogonal axis; an authentic standard is the only path to Level 1.\n\n```python\ndef assign_level(evidence):\n    if evidence.get('authentic_standard_same_method'):\n        return 1\n    if evidence.get('library_match') and evidence['library_match']['score'] >= 0.7 and evidence['library_match']['matches'] >= 6:\n        return '2a'  # reference library spectrum, no in-house standard\n    if evidence.get('diagnostic_fragments') and evidence.get('single_structure_consistent'):\n        return '2b'\n    if evidence.get('candidate_set') or evidence.get('canopus_class') or evidence.get('network_propagated'):\n        return 3  # isomers unresolved, class only, or \"related to\" an annotated node\n    if evidence.get('unambiguous_formula'):\n        return 4  # MS1 + isotopes + adduct logic, no structure\n    return 5\n```\n\n## Per-Method Failure Modes\n\n### Cosine score is not identity\n- **Trigger:** Reporting a name because a single high cosine\u002Fmodified-cosine score came back.\n- **Mechanism:** Cosine rewards shared fragment peaks, and fragments are substructures many distinct molecules share; a high score on few peaks aligns with thousands of unrelated compounds.\n- **Symptom:** Confident name that an isomer or scaffold-sharing compound would have produced identically.\n- **Fix:** Require a matched-peak floor (>=6) alongside the score (>=0.7); prefer spectral entropy for identity; report Level 2a, not Level 1.\n\n### The isomer wall\n- **Trigger:** Claiming a specific positional\u002Fstereo\u002Fregio isomer from MS\u002FMS.\n- **Mechanism:** Constitutional isomers frequently fragment identically; enantiomers have near-identical CID spectra; CSI:FingerID is constitution-only.\n- **Symptom:** A specific structure reported where multiple isomers fit the data equally.\n- **Fix:** Report Level 3 unless RT or CCS breaks the tie (CCS needs ~0.5-0.6% separation); for biology hinging on the isomer, use NMR or a co-eluting standard.\n\n### In-source fragments and adduct cascades corrupt the input\n- **Trigger:** Annotating and counting features before collapsing ion families.\n- **Mechanism:** In-source fragmentation creates phantom MS1 features; assuming the wrong adduct shifts the neutral mass and corrupts every downstream candidate, producing a confident, internally consistent, wrong answer.\n- **Symptom:** Over-counted \"compounds\", the same molecule named several ways, invented biology.\n- **Fix:** Group ion families (CAMERA \u002F Ion Identity Molecular Networking \u002F khipu) before annotation; never quote feature counts as compound counts.\n\n### Database-mapping inflation poisons pathway analysis\n- **Trigger:** Feeding all candidate IDs of an ambiguous feature into enrichment.\n- **Mechanism:** One ambiguous m\u002Fz maps to many compound IDs across different pathways, so a single uncertain feature lights up several pathways (phantom enrichment).\n- **Symptom:** Inflated pathway significance traceable to Level-3 features voting as if they were several confirmed compounds.\n- **Fix:** Carry annotation uncertainty (candidate sets, levels) into enrichment; prefer mass-level or probabilistic methods that do not multiply ambiguous IDs (see metabolomics\u002Fpathway-mapping; mummichog deliberately avoids prior ID).\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|---|---|---|\n| Cosine\u002Fmodified-cosine >= 0.7 AND >= 6 matched peaks | GNPS defaults (Wang 2016) | Suppresses promiscuous low-complexity spectra that hairball the network. |\n| Spectral entropy >= 0.75 -> FDR \u003C 10% | Li 2021 (natural-products benchmark) | Dataset-dependent, NOT a universal constant; entropy beats dot product for identity. |\n| MS1 mass error \u003C= 5 ppm (HRMS) | HRMS convention | Tighter than the 10 ppm older default; pairs with isotope-pattern filter. |\n| Isotope-pattern ~2% abundance accuracy | Kind & Fiehn 2006 | Removes >95% of false formula candidates even at 3 ppm -- orthogonal info, not better mass accuracy, fixes formula. |\n| COSMIC 0.94 \u002F 0.64 \u002F 0.34 ~ 5 \u002F 10 \u002F 20% FDR | Hoffmann 2022 | Calibrated confidence on CSI:FingerID structures; raw top-1 with no COSMIC is Level 3. |\n| Predicted CCS within ~3-5% of measured | AllCCS \u002F IMS benchmarks (Zhou 2020) | Use CCS as a falsifier (rejects candidates), not as positive proof of identity. |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|---|---|---|\n| ModifiedCosine scores all zero | Missing precursor m\u002Fz on spectra | Apply `add_precursor_mz` filter to both references and queries first. |\n| `AttributeError: 'Scores' has no attribute 'scores'` | Indexing `scores.scores[...]` (old tutorials) | Use `scores.scores_by_query(query)` or `scores.to_array(name=...)`. |\n| `ValueError: no field of name \u003CX>_score` | Field names are class-prefixed and version-dependent | Read `pair[1].dtype.names` for the score\u002Fmatches field names rather than hard-coding. |\n| `ImportError: cannot import name 'ModifiedCosine'` | Renamed to `ModifiedCosineGreedy` in matchms 0.33 | Try the new name with an ImportError fallback to the old. |\n| `sirius formula` not found | v5 used singular subcommands; v6 uses `formulas` | Run `sirius --help`; verify plural\u002Fsingular per installed version. |\n| SIRIUS exits at login | Account\u002Flicense required since v5 | `sirius login` once with a free academic account before the chain. |\n| Pathway enrichment lights up everywhere | Ambiguous features mapped to many DB IDs | Collapse ion families and carry levels into enrichment (metabolomics\u002Fpathway-mapping). |\n\n## References\n\n- Sumner LW, et al. 2007. Proposed minimum reporting standards for chemical analysis (CAWG MSI). *Metabolomics* 3:211-221.\n- Schymanski EL, Jeon J, Gulde R, Fenner K, Ruff M, Singer HP, Hollender J. 2014. Identifying small molecules via high resolution mass spectrometry: communicating confidence. *Environ Sci Technol* 48:2097-2098.\n- Li Y, Kind T, Folz J, Vaniya A, Mehta SS, Fiehn O. 2021. Spectral entropy outperforms MS\u002FMS dot product similarity for small-molecule compound identification. *Nat Methods* 18:1524-1531.\n- Dührkop K, Fleischauer M, Ludwig M, Aksenov AA, Melnik AV, Meusel M, Dorrestein PC, Rousu J, Böcker S. 2019. SIRIUS 4: a rapid tool for turning tandem mass spectra into metabolite structure information. *Nat Methods* 16:299-302.\n- Dührkop K, Shen H, Meusel M, Rousu J, Böcker S. 2015. Searching molecular structure databases with tandem mass spectra using CSI:FingerID. *PNAS* 112:12580-12585.\n- Dührkop K, et al. 2021. Systematic classification of unknown metabolites using high-resolution fragmentation mass spectra (CANOPUS). *Nat Biotechnol* 39:462-471.\n- Hoffmann MA, et al. 2022. High-confidence structural annotation of metabolites absent from spectral libraries (COSMIC). *Nat Biotechnol* 40:411-421.\n- Ruttkies C, Schymanski EL, Wolf S, Hollender J, Neumann S. 2016. MetFrag relaunched: incorporating strategies beyond in silico fragmentation. *J Cheminform* 8:3.\n- Wang M, Carver JJ, Phelan VV, et al. 2016. Sharing and community curation of mass spectrometry data with GNPS. *Nat Biotechnol* 34:828-837.\n- Nothias LF, Petras D, Schmid R, et al. 2020. Feature-based molecular networking in the GNPS analysis environment. *Nat Methods* 17:905-908.\n- Kind T, Fiehn O. 2006. Metabolomic database annotations via query of elemental compositions: mass accuracy is insufficient even at less than 1 ppm. *BMC Bioinformatics* 7:234.\n- Zhou Z, et al. 2020. Ion mobility collision cross-section atlas for known and unknown metabolite annotation in untargeted metabolomics (AllCCS). *Nat Commun* 11:4334.\n- Theodoridis G, Gika H, Raftery D, Goodacre R, Plumb RS, Wilson ID. 2023. Ensuring fact-based metabolite identification in LC-MS-based metabolomics. *Anal Chem* 95:3909-3916.\n- Huber F, Verhoeven S, Meijer C, et al. 2020. matchms - processing and similarity evaluation of mass spectrometry data. *J Open Source Softw* 5:2411.\n\n## Related Skills\n\n- metabolomics\u002Fxcms-preprocessing - Upstream feature extraction (m\u002Fz, RT, intensity table)\n- metabolomics\u002Fmsdial-preprocessing - Alternative feature extraction and deconvolution\n- metabolomics\u002Fpathway-mapping - Downstream enrichment that must respect these confidence levels\n- metabolomics\u002Flipidomics - Lipid-specific annotation and structural resolution\n- proteomics\u002Fspectral-libraries - Related spectral-matching concepts (closed-world peptide search)\n","## Version Compatibility\n\nReference examples tested with: matchms 0.33+, SIRIUS 6.x, MetFrag 2.5+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nSpectral matching needs precursor m\u002Fz on every MS\u002FMS spectrum (`add_precursor_mz` filter) or ModifiedCosine silently returns zeros. Level 1 needs an authentic standard run in the same lab under the same method; no software output can substitute for it.\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Metabolite Annotation\n\n**\"Annotate my metabolomics features with compound identities\"** -> Map each feature's m\u002Fz and MS\u002FMS to candidate structures, then attach an explicit confidence level to every name.\n- Python: `matchms.calculate_scores()` for library matching (matchms)\n- CLI: `sirius ... formulas fingerprints structures canopus` for in-silico formula\u002Fstructure\u002Fclass (SIRIUS)\n\n## The Single Most Important Insight -- An Annotation Is a Hypothesis Carrying a Confidence Level, Not an Identification\n\nA metabolite name without a stated MSI\u002FSchymanski level is scientifically incomplete. The inference chain m\u002Fz -> formula -> structure -> isomer-resolved identity is three separate lossy steps, each needing its own orthogonal evidence axis. A database hit supplies a name, not evidence: with no MS\u002FMS or RT to back it, it is Schymanski Level 4 (formula) at best, often Level 5 (a feature of interest). A high cosine score ranks candidates; it never proves one. Only an in-house authentic standard, same method, with MS, MS\u002FMS, and RT all matching reaches Level 1 (\"identification\") -- everything else is an honest hypothesis. The field's recurring sin is laundering Level 2\u002F3 hypotheses into Level-1 prose; the canonical worked example is phenylacetylglutamine being reported as phenylacetylglycine in nearly half of NMR studies (Theodoridis 2023). Assign the lowest level the evidence honestly supports and report which database\u002Fversion was searched.\n\n## Confidence-Level Taxonomy (MSI and Schymanski)\n\n| Schymanski | MSI | Name | Evidence required |\n|---|---|---|---|\n| Level 1 | 1 | Confirmed structure | In-house authentic standard, same method: MS + MS\u002FMS + RT all match. The only \"identification\". |\n| Level 2a | 2 | Probable structure (library) | MS\u002FMS matches a reference library spectrum; no in-house standard. |\n| Level 2b | 2 | Probable structure (diagnostic) | Diagnostic fragments \u002F RT \u002F ionization consistent with exactly one structure; no reference spectrum. |\n| Level 3 | 3 | Tentative candidate(s) | Evidence narrows to a structure class or candidate set but isomers remain unresolved. |\n| Level 4 | -- | Unequivocal formula | MS1 accurate mass + isotope pattern + adduct logic assign one formula; no structure. |\n| Level 5 | 4 | Exact mass | A feature of interest; nothing assigned. |\n\nPromote one level per orthogonal evidence axis that survives scrutiny; cap at Level 2 unless an in-house standard exists. CSI:FingerID and library matching recover constitution only -- no stereochemistry, so enantiomer\u002Fregiochemistry claims cannot come from MS\u002FMS.\n\n## Tool Roles\n\n| Tool | Core idea | Output | Best for |\n|---|---|---|---|\n| matchms (CosineGreedy \u002F ModifiedCosine \u002F spectral entropy) | Score query MS\u002FMS against library spectra | Ranked library hits + matched-peak count | Level 2a when a library spectrum exists |\n| SIRIUS + ZODIAC | Fragmentation trees + isotope pattern, dataset-wide formula re-ranking | Ranked molecular formula | Formula (Level 4); the reliable part of SIRIUS |\n| CSI:FingerID + COSMIC | Predict fingerprint, search structure DB, calibrated confidence | Ranked structures + FDR-controllable score | Level 2b\u002F3 structure when COSMIC FDR is set |\n| CANOPUS | Predict compound class directly from MS2 | ClassyFire + NPClassifier class | Level 3 class for unknowns; often the most honest output |\n| MetFrag | Bond-disconnection scoring of candidate list | Explainable fragment-supported ranks | Transparent, scriptable, custom DBs, RT term |\n| FBMN (GNPS2) + MS2Query | Modified-cosine network \u002F ML analogue search | Edges = \"related to\" | Analogue propagation (Level 3 scaffold hypothesis) |\n\n## Decision Tree: Evidence Available -> Tool -> Achievable Level\n\n| Situation | Do | Achievable level |\n|---|---|---|\n| In-house authentic standard, same method, MS+MS\u002FMS+RT match | Confirm against standard | Level 1 |\n| MS\u002FMS available, library spectrum likely exists | matchms library match (entropy or modified cosine) | Level 2a |\n| MS\u002FMS available, no library spectrum | SIRIUS formulas + CSI:FingerID + CANOPUS, or MetFrag | Level 2b\u002F3 (formula Level 4) |\n| Need class only \u002F compound absent from all DBs | CANOPUS (class); MSNovelist (de novo SMILES) | Level 3 |\n| Find analogues \u002F propagate across a network | FBMN on GNPS2 + MS2Query | Level 3 (scaffold hypothesis) |\n| Only MS1 m\u002Fz + isotopes + clean adduct | Formula assignment (SIRIUS \u002F seven golden rules) | Level 4 |\n| Bare m\u002Fz, no orthogonal evidence | Report as a feature | Level 5 |\n| Biology hinges on a specific isomer \u002F stereocenter | Demand a standard or orthogonal method (NMR, chiral assay) | MS alone insufficient |\n\n## Match MS\u002FMS Against a Spectral Library\n\n**Goal:** Rank library candidates for each query spectrum and attach the matched-peak count, not just the score.\n\n**Approach:** Harmonize metadata, normalize intensities, add precursor m\u002Fz, score with ModifiedCosine (analogue-aware) or spectral entropy (identity), then keep only hits above both a score and a matched-peak floor.\n\n```python\nfrom matchms import calculate_scores\nfrom matchms.filtering import default_filters, normalize_intensities, add_precursor_mz\ntry:\n    from matchms.similarity import ModifiedCosineGreedy as ModifiedCosine  # matchms 0.33+\nexcept ImportError:\n    from matchms.similarity import ModifiedCosine          # matchms \u003C= 0.32\n\ndef prepare(spectrum):\n    spectrum = default_filters(spectrum)\n    spectrum = add_precursor_mz(spectrum)  # required for ModifiedCosine or scores are zero\n    return normalize_intensities(spectrum)\n\nqueries = [prepare(s) for s in queries_raw]\nreferences = [prepare(s) for s in references_raw]\n\nscores = calculate_scores(references, queries, ModifiedCosine(tolerance=0.005))\n\n# CosineGreedy\u002FModifiedCosine return a structured array; the field names are\n# class-prefixed and version-dependent (e.g. 'ModifiedCosineGreedy_score' in 0.33),\n# so derive them from the dtype rather than hard-coding.\nfor query in queries:\n    pairs = scores.scores_by_query(query)\n    score_field, match_field = pairs[0][1].dtype.names\n    ref, hit = max(pairs, key=lambda pair: pair[1][score_field])\n    if hit[score_field] >= 0.7 and hit[match_field] >= 6:  # score floor + peak-count floor (GNPS defaults)\n        print(ref.get('compound_name'), hit[score_field], hit[match_field])  # Level 2a candidate\n```\n\n## Run SIRIUS for Formula, Structure, and Class\n\n**Goal:** Annotate features that have no library spectrum, reporting formula and class with more trust than top-1 structure.\n\n**Approach:** Run the SIRIUS subcommand chain on one project space; trust ZODIAC-refined formula over CSI:FingerID structure, and only report a structure as confident when a COSMIC FDR threshold is set.\n\n```bash\n# SIRIUS 6 is a multi-command pipeline on one line. A free academic account\u002Flicense\n# is required (since v5); log in once, then the project space persists across runs.\n# Credential flags vary by version; run `sirius login --help` to confirm (commonly `-u \u003Cemail>`).\nsirius login -u \"$SIRIUS_USER\"\n\nsirius --input features.mgf --project .\u002Fsirius_project \\\n    formulas --profile orbitrap \\\n    fingerprints \\\n    structures --database bio \\\n    canopus \\\n    write-summaries --output .\u002Fsirius_summary\n# Verify exact subcommand spelling with `sirius \u003Ccommand> --help`: formulas\u002Ffingerprints\u002F\n# structures\u002Fcanopus changed plural\u002Fsingular and options between v5 and v6.\n# --database (on structures) is a scientific choice: 'bio' raises plausibility but cannot\n# return a novel metabolite; 'pubchem' maximizes recall but floods implausible isomers.\n```\n\n## Assemble an Evidence-to-Level Call\n\n**Goal:** Collapse a feature's evidence set into a single defensible confidence level.\n\n**Approach:** Start at Level 5 and promote per surviving orthogonal axis; an authentic standard is the only path to Level 1.\n\n```python\ndef assign_level(evidence):\n    if evidence.get('authentic_standard_same_method'):\n        return 1\n    if evidence.get('library_match') and evidence['library_match']['score'] >= 0.7 and evidence['library_match']['matches'] >= 6:\n        return '2a'  # reference library spectrum, no in-house standard\n    if evidence.get('diagnostic_fragments') and evidence.get('single_structure_consistent'):\n        return '2b'\n    if evidence.get('candidate_set') or evidence.get('canopus_class') or evidence.get('network_propagated'):\n        return 3  # isomers unresolved, class only, or \"related to\" an annotated node\n    if evidence.get('unambiguous_formula'):\n        return 4  # MS1 + isotopes + adduct logic, no structure\n    return 5\n```\n\n## Per-Method Failure Modes\n\n### Cosine score is not identity\n- **Trigger:** Reporting a name because a single high cosine\u002Fmodified-cosine score came back.\n- **Mechanism:** Cosine rewards shared fragment peaks, and fragments are substructures many distinct molecules share; a high score on few peaks aligns with thousands of unrelated compounds.\n- **Symptom:** Confident name that an isomer or scaffold-sharing compound would have produced identically.\n- **Fix:** Require a matched-peak floor (>=6) alongside the score (>=0.7); prefer spectral entropy for identity; report Level 2a, not Level 1.\n\n### The isomer wall\n- **Trigger:** Claiming a specific positional\u002Fstereo\u002Fregio isomer from MS\u002FMS.\n- **Mechanism:** Constitutional isomers frequently fragment identically; enantiomers have near-identical CID spectra; CSI:FingerID is constitution-only.\n- **Symptom:** A specific structure reported where multiple isomers fit the data equally.\n- **Fix:** Report Level 3 unless RT or CCS breaks the tie (CCS needs ~0.5-0.6% separation); for biology hinging on the isomer, use NMR or a co-eluting standard.\n\n### In-source fragments and adduct cascades corrupt the input\n- **Trigger:** Annotating and counting features before collapsing ion families.\n- **Mechanism:** In-source fragmentation creates phantom MS1 features; assuming the wrong adduct shifts the neutral mass and corrupts every downstream candidate, producing a confident, internally consistent, wrong answer.\n- **Symptom:** Over-counted \"compounds\", the same molecule named several ways, invented biology.\n- **Fix:** Group ion families (CAMERA \u002F Ion Identity Molecular Networking \u002F khipu) before annotation; never quote feature counts as compound counts.\n\n### Database-mapping inflation poisons pathway analysis\n- **Trigger:** Feeding all candidate IDs of an ambiguous feature into enrichment.\n- **Mechanism:** One ambiguous m\u002Fz maps to many compound IDs across different pathways, so a single uncertain feature lights up several pathways (phantom enrichment).\n- **Symptom:** Inflated pathway significance traceable to Level-3 features voting as if they were several confirmed compounds.\n- **Fix:** Carry annotation uncertainty (candidate sets, levels) into enrichment; prefer mass-level or probabilistic methods that do not multiply ambiguous IDs (see metabolomics\u002Fpathway-mapping; mummichog deliberately avoids prior ID).\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|---|---|---|\n| Cosine\u002Fmodified-cosine >= 0.7 AND >= 6 matched peaks | GNPS defaults (Wang 2016) | Suppresses promiscuous low-complexity spectra that hairball the network. |\n| Spectral entropy >= 0.75 -> FDR \u003C 10% | Li 2021 (natural-products benchmark) | Dataset-dependent, NOT a universal constant; entropy beats dot product for identity. |\n| MS1 mass error \u003C= 5 ppm (HRMS) | HRMS convention | Tighter than the 10 ppm older default; pairs with isotope-pattern filter. |\n| Isotope-pattern ~2% abundance accuracy | Kind & Fiehn 2006 | Removes >95% of false formula candidates even at 3 ppm -- orthogonal info, not better mass accuracy, fixes formula. |\n| COSMIC 0.94 \u002F 0.64 \u002F 0.34 ~ 5 \u002F 10 \u002F 20% FDR | Hoffmann 2022 | Calibrated confidence on CSI:FingerID structures; raw top-1 with no COSMIC is Level 3. |\n| Predicted CCS within ~3-5% of measured | AllCCS \u002F IMS benchmarks (Zhou 2020) | Use CCS as a falsifier (rejects candidates), not as positive proof of identity. |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|---|---|---|\n| ModifiedCosine scores all zero | Missing precursor m\u002Fz on spectra | Apply `add_precursor_mz` filter to both references and queries first. |\n| `AttributeError: 'Scores' has no attribute 'scores'` | Indexing `scores.scores[...]` (old tutorials) | Use `scores.scores_by_query(query)` or `scores.to_array(name=...)`. |\n| `ValueError: no field of name \u003CX>_score` | Field names are class-prefixed and version-dependent | Read `pair[1].dtype.names` for the score\u002Fmatches field names rather than hard-coding. |\n| `ImportError: cannot import name 'ModifiedCosine'` | Renamed to `ModifiedCosineGreedy` in matchms 0.33 | Try the new name with an ImportError fallback to the old. |\n| `sirius formula` not found | v5 used singular subcommands; v6 uses `formulas` | Run `sirius --help`; verify plural\u002Fsingular per installed version. |\n| SIRIUS exits at login | Account\u002Flicense required since v5 | `sirius login` once with a free academic account before the chain. |\n| Pathway enrichment lights up everywhere | Ambiguous features mapped to many DB IDs | Collapse ion families and carry levels into enrichment (metabolomics\u002Fpathway-mapping). |\n\n## References\n\n- Sumner LW, et al. 2007. Proposed minimum reporting standards for chemical analysis (CAWG MSI). *Metabolomics* 3:211-221.\n- Schymanski EL, Jeon J, Gulde R, Fenner K, Ruff M, Singer HP, Hollender J. 2014. Identifying small molecules via high resolution mass spectrometry: communicating confidence. *Environ Sci Technol* 48:2097-2098.\n- Li Y, Kind T, Folz J, Vaniya A, Mehta SS, Fiehn O. 2021. Spectral entropy outperforms MS\u002FMS dot product similarity for small-molecule compound identification. *Nat Methods* 18:1524-1531.\n- Dührkop K, Fleischauer M, Ludwig M, Aksenov AA, Melnik AV, Meusel M, Dorrestein PC, Rousu J, Böcker S. 2019. SIRIUS 4: a rapid tool for turning tandem mass spectra into metabolite structure information. *Nat Methods* 16:299-302.\n- Dührkop K, Shen H, Meusel M, Rousu J, Böcker S. 2015. Searching molecular structure databases with tandem mass spectra using CSI:FingerID. *PNAS* 112:12580-12585.\n- Dührkop K, et al. 2021. Systematic classification of unknown metabolites using high-resolution fragmentation mass spectra (CANOPUS). *Nat Biotechnol* 39:462-471.\n- Hoffmann MA, et al. 2022. High-confidence structural annotation of metabolites absent from spectral libraries (COSMIC). *Nat Biotechnol* 40:411-421.\n- Ruttkies C, Schymanski EL, Wolf S, Hollender J, Neumann S. 2016. MetFrag relaunched: incorporating strategies beyond in silico fragmentation. *J Cheminform* 8:3.\n- Wang M, Carver JJ, Phelan VV, et al. 2016. Sharing and community curation of mass spectrometry data with GNPS. *Nat Biotechnol* 34:828-837.\n- Nothias LF, Petras D, Schmid R, et al. 2020. Feature-based molecular networking in the GNPS analysis environment. *Nat Methods* 17:905-908.\n- Kind T, Fiehn O. 2006. Metabolomic database annotations via query of elemental compositions: mass accuracy is insufficient even at less than 1 ppm. *BMC Bioinformatics* 7:234.\n- Zhou Z, et al. 2020. Ion mobility collision cross-section atlas for known and unknown metabolite annotation in untargeted metabolomics (AllCCS). *Nat Commun* 11:4334.\n- Theodoridis G, Gika H, Raftery D, Goodacre R, Plumb RS, Wilson ID. 2023. Ensuring fact-based metabolite identification in LC-MS-based metabolomics. *Anal Chem* 95:3909-3916.\n- Huber F, Verhoeven S, Meijer C, et al. 2020. matchms - processing and similarity evaluation of mass spectrometry data. *J Open Source Softw* 5:2411.\n\n## Related Skills\n\n- metabolomics\u002Fxcms-preprocessing - Upstream feature extraction (m\u002Fz, RT, intensity table)\n- metabolomics\u002Fmsdial-preprocessing - Alternative feature extraction and deconvolution\n- metabolomics\u002Fpathway-mapping - Downstream enrichment that must respect these confidence levels\n- metabolomics\u002Flipidomics - Lipid-specific annotation and structural resolution\n- proteomics\u002Fspectral-libraries - Related spectral-matching concepts (closed-world peptide search)\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","mixed","2026-09-20","metabolomics\u002Fmetabolite-annotation\u002FSKILL.md","matchms","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-metabolomics-metabolite-annotation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-metabolomics-metabolite-annotation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-metabolomics-metabolite-annotation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-metabolomics-metabolite-annotation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-metabolomics-metabolite-annotation\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fannotate_features.py","SCRIPT","脚本",3096,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-metabolomics-metabolite-annotation\u002Fexamples\u002Fannotate_features.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",4248,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-metabolomics-metabolite-annotation\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]