---
name: nps-classification-prediction
description: Use when you have acquired a mass spectrum from an unknown suspected illicit drug analyte and need to compare it against a synthetic NPS database to rank candidate identities by similarity.
license: CC-BY-4.0
metadata:
  edam_operation: http://edamontology.org/operation_3767
  edam_topics:
  - http://edamontology.org/topic_3172
  - http://edamontology.org/topic_0769
  tools:
  - PS2MS
  - NEIMS
  - DeepEI
  - PS²MS Enumeration
  - RDKit
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/v1
  assembled_by: scripts/collect_metabolomics_collection.py
  sources:
  - build: coll_ps2ms
    doi: 10.1021/acs.analchem.3c05019
    title: ps2ms
  dedup_kept_from: coll_ps2ms
schema_version: 0.2.0
---

# NPS Classification Prediction

## Summary

Apply the PS²MS deep learning system to predict and classify unknown mass spectra against a synthetic database of new psychoactive substance (NPS) derivatives, generating ranked similarity scores and potential NPS identities. This skill is used when you have an unknown analyte's mass spectrum and need to identify it among possible NPS compounds derived from a core illicit drug structure.

## When to use

You have acquired a mass spectrum from an unknown suspected illicit drug analyte and need to compare it against a synthetic NPS database to rank candidate identities by similarity. The analyte spectrum should be preprocessed into tokenized m/z and intensity pairs, and you must have a pre-constructed synthetic database of NPS derivatives with predicted mass spectra and chemical fingerprints.

## When NOT to use

- The input analyte is a known, structurally characterized compound already in a reference spectral library — use standard spectral matching instead.
- You do not have a pre-enumerated synthetic NPS database specific to your suspected core drug structure — you must first run the enumeration step.
- The unknown spectrum is of poor quality (low signal-to-noise, sparse peaks) and cannot be reliably preprocessed into valid m/z–intensity tokens.

## Inputs

- Unknown mass spectrum (raw spectra or processed m/z–intensity pairs in PS²MS-compatible schema)
- Pre-trained DeepEI model (for fingerprint prediction on unknown analyte)
- Synthetic NPS database with predicted mass spectra and chemical fingerprints

## Outputs

- Ranked list of candidate NPS identities (typically top 100 compounds)
- Per-candidate integrated similarity scores (SMSF)
- Predicted NPS class labels with confidence scores
- Structured prediction table (spectrum identifier, predicted NPS classes, per-class probabilities)

## How to apply

Load the unknown analyte's mass spectrum and preprocess it according to PS²MS normalization requirements (tokenization of m/z and intensity pairs). Extract its chemical fingerprint using DeepEI. Retrieve the pre-computed synthetic NPS database containing predicted spectra (generated by NEIMS) and fingerprints (generated by DeepEI) for all enumerated derivatives of the core drug structure. Calculate integrated similarity scores (SMSF) between the analyte's spectrum and fingerprint against all database compounds using both mass spectrometry and chemical fingerprint matching. Rank the results by similarity score and filter to retain the top-ranked candidates (typically the 100 most similar compounds). Post-process to assign predicted NPS class labels with confidence scores derived from the ranking.

## Related tools

- **NEIMS** (Generates predicted mass spectra for all NPS derivatives in the synthetic database) — https://github.com/jhhung/PS2MS
- **DeepEI** (Predicts chemical fingerprints for the unknown analyte and all synthetic database compounds) — https://github.com/jhhung/PS2MS
- **PS²MS Enumeration** (Generates synthetic NPS database by enumerating possible derivatives based on core drug structure) — https://github.com/jhhung/PS2MS
- **RDKit** (Chemistry toolkit used for molecular structure manipulation and fingerprint calculations) — https://www.rdkit.org

## Evaluation signals

- Verify that the analyte's fingerprint vector matches the DeepEI output schema and dimensionality used to construct the synthetic database.
- Confirm that integrated similarity scores (SMSF) are monotonically ranked (highest score first) and fall within a defined range (e.g., 0–1 or 0–100).
- Check that the top-ranked candidate(s) show significantly higher SMSF than lower-ranked compounds, indicating clear differentiation.
- Validate that per-class probability scores sum to 1.0 (or 100%) across all predicted NPS classes.
- For known reference compounds, verify that the correct NPS identity appears in the top-ranked list with high confidence.

## Limitations

- PS²MS prediction accuracy depends entirely on the completeness and representativeness of the pre-enumerated synthetic database; novel derivatives not covered by the enumeration step will not be detected.
- The system requires high-quality mass spectrometry data; poor-quality spectra with sparse or noisy peaks may yield unreliable fingerprint predictions and low similarity scores across all candidates.
- The synthetic database generation is computationally expensive and must be re-run for each new core drug structure; the skill assumes the database is pre-computed.
- Integrated similarity scores are heuristic-driven and may not have established statistical significance thresholds; interpretation of borderline scores requires expert judgment.

## Evidence

- [readme] PS²MS is designed specifically to address the limitations of identifying the emergence of unidentified novel illicit drugs.: "PS<sup>2</sup>MS is designed specifically to address the limitations of identifying the emergence of unidentified novel illicit drugs."
- [readme] PS²MS 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 generate mass spectra and chemical fingerprints, respectively. Finally, PS²MS 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.: "PS<sup>2</sup>MS 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"
- [other] Preprocess spectra according to PS2MS normalization and feature extraction requirements (tokenization/vectorization of m/z and intensity pairs).: "Preprocess spectra according to PS2MS normalization and feature extraction requirements (tokenization/vectorization of m/z and intensity pairs)."
- [other] Post-process predictions to assign NPS class labels and filter by model confidence threshold.: "Post-process predictions to assign NPS class labels and filter by model confidence threshold."
- [readme] The final step of PS<sup>2</sup>MS is to compare the analyte and the synthetic database. The system will compare the spectrum and chemical fingerprint between compounds and generate a list of the hundred most similar compounds which are ranked by similarity score.: "The final step of PS<sup>2</sup>MS is to compare the analyte and the synthetic database. The system will compare the spectrum and chemical fingerprint between compounds and generate a list of the"
