Skip to content
Back to skills

Neural Network Model Inference

ASecurity

Use when you have pre-trained MSGO model weights (PFAS or lipid variant)

  • 16 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
ai-agentspythongogitperformance

Works with

  • cursor

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add HolobiomicsLab/asb-skill-collections --skill neural-network-model-inference --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Neural Network Model Inference?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Neural Network Model Inference
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/holobiomicslab-neural-network-model-inference/badge)](https://www.skillsdirectory.com/skills/holobiomicslab-neural-network-model-inference)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: neural-network-model-inference
description: Use when you have pre-trained MSGO model weights (PFAS or lipid variant)
  and a set of experimental mass spectra (either from reference evaluation sets or
  real wastewater/environmental samples) in CSV format with m/z and intensity pairs,
  and you need to obtain candidate molecular structures ranked.
license: CC-BY-4.0
metadata:
  edam_operation: http://edamontology.org/operation_3633
  edam_topics:
  - http://edamontology.org/topic_0154
  - http://edamontology.org/topic_3172
  tools:
  - Python 3.7
  - Torch 1.7.1
  - Torch
  - Python
  - MSGO model
  - MSGO
  - PyTorch
  techniques:
  - mass-spectrometry
  license_tier: open
  provenance_tier: literature
derived_from:
- doi: 10.1038/s42256-025-01140-5
  title: MSGo
evidence_spans:
- 'Python: 3.7'
- 'Torch: 1.7.1'
- github.com__aaronma2020__MSGO
claims: []
provenance:
  collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
  assembled_by: scripts/collect_metabolomics_collection.py
  sources:
  - build: coll_msgo_cq
    doi: 10.1038/s42256-025-01140-5
    title: MSGo
  dedup_kept_from: coll_msgo_cq
schema_version: 0.2.0
attribution:
  generator: AgenticScienceBuilder
  original_doi: 10.1038/s42256-025-01140-5
  all_source_dois:
  - 10.1038/s42256-025-01140-5
  zenodo_doi: 10.5281/zenodo.20794027
  curators: []
  promoter: Louis-Félix Nothias
  sponsor: CNRS & Université Côte d'Azur
---

# neural-network-model-inference

## Summary

Execute pre-trained neural network model weights on new spectrometric data to generate molecular structure predictions. This skill applies a learned MSGO model to mass spectrometry or LC–QTOF spectra to produce ranked SMILES structure predictions with confidence scores.

## When to use

You have pre-trained MSGO model weights (PFAS or lipid variant) and a set of experimental mass spectra (either from reference evaluation sets or real wastewater/environmental samples) in CSV format with m/z and intensity pairs, and you need to obtain candidate molecular structures ranked by model confidence for each spectrum.

## When NOT to use

- Input spectra are not in the expected CSV format or lack required metadata (precursor m/z, polarity).
- You do not have pre-trained MSGO weights; you need to train a model first on pseudo SMILES-spectrum pairs.
- Your spectra come from a different analytical platform (not mass spectrometry) or require different preprocessing than mass spectrum peak lists.

## Inputs

- Pre-trained MSGO PyTorch model checkpoint (PFAS or lipid variant)
- CSV file with experimental spectra (m/z, intensity, precursor m/z, polarity)
- Model configuration parameters (beam_size, polarity)

## Outputs

- CSV results file with top 10 predicted SMILES structures per spectrum
- Confidence scores or ranking for each predicted structure
- Molecular structure annotations for each experimental spectrum

## How to apply

Load the pre-trained MSGO model weights from the released repository (PFAS or lipid checkpoint) using PyTorch 1.7.1 in Python 3.7. Preprocess input spectra to match the model's expected format (CSV with spectrum metadata and peak lists). Execute inference via tools/eval_standard.py with appropriate parameters: set beam_size (500 for PFAS, 300 for lipid) to control prediction breadth, specify polarity (neg for PFAS, pos for lipid), and set the output CSV path. The model performs forward pass on each spectrum and returns top-ranked SMILES predictions with corresponding confidence scores. Collect results into a CSV containing top 10 predictions per spectrum for downstream validation or literature annotation.

## Related tools

- **MSGO** (Pre-trained neural network model that performs structure generation inference on mass spectra) — https://github.com/aaronma2020/MSGO
- **PyTorch** (Deep learning framework (version 1.7.1) used to load and execute the MSGO model weights)
- **Python** (Runtime environment (version 3.7) for executing inference scripts)

## Examples

```
python tools/eval_standard.py --log_path ckpts/pfas --real_csv ./data/example/pfas.csv --out_csv ./pfas_results.csv --beam_size 500 --polar neg
```

## Evaluation signals

- Output CSV file is created with the expected schema (spectrum ID, top 10 SMILES predictions, confidence scores).
- Number of predictions per spectrum equals or is less than beam_size parameter.
- All predicted SMILES strings are valid chemical notation (verifiable by RDKit or chemistry validation library).
- Predictions on 300+ real spectrum evaluation set match or closely reproduce the reported structure-generation performance metrics from the paper.
- For wastewater LC–QTOF dataset, predicted structures can be validated against reference compounds or literature annotations.

## Limitations

- Model is specialized for PFAS or lipid structure elucidation; cross-domain applicability to other chemical classes is not demonstrated.
- Performance depends on spectrum quality and similarity to training distribution (pseudo SMILES-spectrum pairs generated by CFM-ID); novel spectra dissimilar to training data may yield lower-confidence predictions.
- The model was trained on pseudo data; real wastewater validation was performed on only one LC–QTOF dataset, limiting generalization to other real-world sample matrices.
- Inference requires exact PyTorch 1.7.1 and Python 3.7 versions; compatibility with newer versions is not stated.

## Evidence

- [other] Load the pre-trained MSGO model weights from the released github.com/aaronma2020/MSGO repository using Python 3.7 and Torch 1.7.1.: "Load the pre-trained MSGO model weights from the released github.com/aaronma2020/MSGO repository using Python 3.7 and Torch 1.7.1."
- [other] Perform inference using MSGO to generate predicted SMILES structures and corresponding confidence scores for each spectrum.: "Perform inference using MSGO to generate predicted SMILES structures and corresponding confidence scores for each spectrum."
- [readme] Download the model weights in ckpts/pfas or ckpts/lipid, run python tools/eval.py --log_path [ckpts/pfas or ckpts/lipid]: "Download the model weights in ckpts/pfas or ckpts/lipid, run
```
python tools/eval.py --log_path [ckpts/pfas or ckpts/lipid]"
- [readme] For pfas, run: python tools/eval_standard.py --log_path ckpts/pfas --real_csv ./data/example/pfas.csv --out_csv ./pfas_results.csv --beam_size 500 --polar neg: "For pfas, run :
```
python tools/eval_standard.py --log_path ckpts/pfas --real_csv ./data/example/pfas.csv --out_csv ./pfas_results.csv --beam_size 500 --polar neg"
- [readme] Then you can obatin a results csv file inluding top 10 predicts.: "Then you can obatin a results csv file inluding top 10 predicts."
- [other] The MSGO model was evaluated on one LC–QTOF dataset of wastewater samples to verify its capability for real-sample molecular structure elucidation.: "The MSGO model was evaluated on one LC–QTOF dataset of wastewater samples to verify its capability for real-sample molecular structure elucidation."

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.