---
name: compound-class-prediction-from-spectra
description: Use when you have an unknown mass spectrometry spectrum (acquired experimentally
  or computationally) and need to assign it to a known drug class or identify candidate
  structures.
license: CC-BY-4.0
metadata:
  edam_operation: http://edamontology.org/operation_3632
  edam_topics:
  - http://edamontology.org/topic_0657
  - http://edamontology.org/topic_3520
  tools:
  - PS2MS
  - NEIMS
  - DeepEI
  techniques:
  - mass-spectrometry
  license_tier: restricted
derived_from:
- doi: 10.1021/acs.analchem.3c05019
  title: ps2ms
evidence_spans:
- jhhung/PS2MS
claims: []
provenance:
  collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
  assembled_by: scripts/collect_metabolomics_collection.py
  sources:
  - build: coll_ps2ms_cq
    doi: 10.1021/acs.analchem.3c05019
    title: ps2ms
  dedup_kept_from: coll_ps2ms_cq
schema_version: 0.2.0
attribution:
  generator: AgenticScienceBuilder
  original_doi: 10.1021/acs.analchem.3c05019
  all_source_dois:
  - 10.1021/acs.analchem.3c05019
  zenodo_doi: 10.5281/zenodo.20794027
  curators: []
  promoter: Louis-Félix Nothias
  sponsor: CNRS & Université Côte d'Azur
---

# compound-class-prediction-from-spectra

> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
## Summary

Predict the chemical class or identity of an unknown compound from its mass spectrometry spectrum using a pre-trained deep learning model. This skill applies neural network inference to classify novel psychoactive substances and other compounds by comparing their spectral signatures against learned patterns.

## When to use

You have an unknown mass spectrometry spectrum (acquired experimentally or computationally) and need to assign it to a known drug class or identify candidate structures. This is especially valuable when the unknown compound is a novel derivative or analog not in standard reference libraries, and you want a ranked list of candidate identities with confidence scores rather than a single binary match/no-match decision.

## When NOT to use

- Your spectrum comes from a compound already in a standard reference library with a direct database match available—use exact mass or spectral library search instead.
- You are working with compounds from a chemical class the model was not trained on; model performance is class-specific and will degrade for out-of-distribution analytes.
- Your mass spectrometry data is severely noisy, poorly normalized, or in a format incompatible with the model's expected input (e.g., raw uncalibrated m/z values); preprocess and validate format first.

## Inputs

- mass spectrometry spectrum (msp format or raw spectral data with m/z and intensity pairs)
- pre-trained deep learning model weights
- synthetic compound database (msp with predicted spectra and fingerprints)
- unknown analyte identification parameters (core drug structure, enumeration rules, if using generative approach)

## Outputs

- ranked list of candidate compound identities
- confidence scores or similarity scores (SMSF) for each candidate
- class label or chemical family assignment
- classification metrics (accuracy, precision, recall, F1-score) when ground truth is available

## How to apply

Load a pre-trained deep learning model (such as PS2MS, which combines NEIMS for spectrum prediction and DeepEI for fingerprint prediction) and prepare your unknown spectrum in the format expected by the model—typically normalized mass spectrometry data in msp or similar structured format. Run inference on the unknown spectrum to generate class predictions and confidence scores. The model compares the unknown spectrum and computed chemical fingerprint against a synthetic database of derivatives (generated by structural enumeration and in silico spectral prediction) and returns a ranked list of candidate compounds scored by integrated similarity (SMSF). Validate predictions by computing classification metrics (accuracy, precision, recall, F1-score) against reference outputs if available, and by examining whether top-ranked candidates match known reference standards or expert validation.

## Related tools

- **NEIMS** (predicts mass spectra of synthetic database compounds to enable spectral matching against unknowns)
- **DeepEI** (computes chemical fingerprints for both unknown analytes and database compounds to provide fingerprint-based similarity scoring)
- **PS2MS** (orchestrates the full compound identification workflow: enumeration, spectrum prediction, fingerprint calculation, and similarity ranking) — https://github.com/jhhung/PS2MS

## Evaluation signals

- Classification metrics (accuracy, precision, recall, F1-score) computed on test set match or exceed reported benchmarks from the paper.
- Top-ranked candidate compounds for unknowns align with expert manual identification or confirmatory reference standards (e.g., cosine similarity or SMSF scores above publication threshold).
- Predictions include confidence/similarity scores; verify that high-confidence predictions (e.g., SMSF > 0.7 or top 1% of candidates) have higher validation success than low-confidence predictions.
- Output format and structure conform to the expected schema: ranked list with compound IDs, similarity scores, and chemical fingerprint information.
- No predictions are generated for compounds outside the model's training domain without explicit out-of-distribution flagging or degraded confidence metrics.

## Limitations

- PS2MS is designed specifically for novel psychoactive substances (NPS) and derivatives; performance on other chemical classes is not documented and likely reduced.
- The model requires a well-defined core drug structure for synthetic database enumeration; compounds with no known parent structure or ambiguous core cannot be processed.
- Mass spectrometry data must be normalized and formatted as specified by the model; incompatible spectral formats, uncalibrated m/z, or missing intensity normalization will produce invalid results.
- Predictions are confined to the synthetic database generated from enumerated derivatives; novel compounds with substitution patterns or core structures not in the enumeration space will not be correctly identified.
- The integrated similarity score (SMSF) combines spectrum and fingerprint features; sensitivity to either modality (e.g., poor spectrum prediction or fingerprint accuracy) can reduce overall prediction confidence.

## Evidence

- [other] PS2MS is a deep learning-based prediction system designed to detect novel new psychoactive substances using mass spectrometry.: "PS2MS is designed specifically to address the limitations of identifying the emergence of unidentified novel illicit drugs."
- [other] The workflow involves spectrum and fingerprint prediction, synthetic database generation, and ranked candidate scoring.: "PS2MS builds a synthetic NPS database by enumerating possible derivatives based on the core structure of a preselected illicit drug. The system leverages two deep learning tools, NEIMS and DeepEI, to"
- [other] Comparison is performed using integrated similarity scores (SMSF) between the unknown and database candidates.: "PS2MS calculates the integrated similarity scores(SMSF) between the unknown analyte and the derivatives from synthetic database and yields a list of potential NPS identities for the analyte."
- [other] Input data must be mass spectrometry spectra in the format specified by the repository.: "Prepare mass spectrometry spectral data in the format expected by the model (structure and normalization as specified in the repository)."
- [other] Validation includes computing classification metrics and comparing predictions to reference outputs.: "Compute classification metrics (accuracy, precision, recall, F1-score) and validate that predictions match expected outputs within tolerance."
