In silico spectrum generation cfmid
Use when when you have a list of SMILES strings representing chemical structures and need to create paired SMILES-spectrum training data for a generative model (like MSGO) without requiring experimental mass spectra.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill in-silico-spectrum-generation-cfmidAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 15 stars15 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 file declares
Copied from the file, not written here
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
6.7 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
in-silico-spectrum-generation-cfmid
Summary
Generate in silico mass spectra with fragmentation patterns from chemical structure SMILES strings using CFM-ID, producing pseudo SMILES-spectrum pairs for training molecular structure prediction models. This skill is essential for synthetically augmenting training data when real experimental spectra are scarce or when covering chemical diversity beyond available measurements.
When to use
When you have a list of SMILES strings representing chemical structures and need to create paired SMILES-spectrum training data for a generative model (like MSGO) without requiring experimental mass spectra. Use this when you need 30,000+ pseudo pairs to train a deep learning model for unknown chemical identification, or when you aim to expand training coverage across chemical families (e.g., PFAS, lipids) for which real spectral data may be limited or expensive to acquire.
When NOT to use
- You already have high-quality experimental mass spectra for your training set; use those directly instead.
- Your goal is to validate or benchmark predictions against real spectra; pseudo spectra alone cannot serve as ground truth for model evaluation.
- Your input SMILES strings are invalid, disconnected, or outside the chemical scope of CFM-ID (e.g., inorganic compounds, highly exotic structures).
Inputs
- List of SMILES strings (text file or Python iterable)
- CFM-ID executable or API access
Outputs
- SMILES-spectrum pair dataset (≥30,000 pairs)
- Training data file containing valid SMILES and corresponding spectrum representations
How to apply
Load a list of SMILES strings from an input file. For each SMILES string, invoke CFM-ID to generate in silico mass spectra including fragmentation patterns. Pair each input SMILES with its corresponding CFM-ID-generated spectrum representation to create pseudo SMILES-spectrum pairs. Aggregate all pairs into a single training dataset file, ensuring you reach the target of 30,000+ pairs. Validate that the output file contains the expected number of pairs with both valid SMILES strings and corresponding spectrum representations for each entry. The rationale is that CFM-ID's fragmentation model provides realistic MS/MS patterns, allowing the downstream MSGO model to learn structure-spectrum relationships without access to expensive experimental LC–QTOF or other instrumental data.
Related tools
- cfmid (Invoked for each SMILES string to generate in silico mass spectra with fragmentation patterns)
- Python 3.7 (Orchestrates SMILES loading, CFM-ID invocation loops, pair aggregation, and validation)
- MSGO (Downstream model trained on the pseudo SMILES-spectrum pairs to predict unknown chemical structures from real spectra) — github.com/aaronma2020/MSGO
Evaluation signals
- Output file contains exactly ≥30,000 SMILES-spectrum pairs with no missing entries.
- Each pair includes a valid, non-empty SMILES string and a corresponding spectrum representation (e.g., m/z intensity vector or fragmentation pattern).
- Sample validation: spot-check 50–100 random pairs to confirm CFM-ID spectra are chemically plausible (e.g., major peaks correspond to expected fragments for the input SMILES).
- Training curve: downstream MSGO model trained on generated pairs converges and achieves reasonable loss on validation data; model can generate plausible structure predictions on held-out spectra.
- Parity check: Verify that the number of successfully paired records matches the input SMILES count; any discrepancies indicate CFM-ID failures or malformed inputs.
Limitations
- CFM-ID generates fragmentation patterns based on computational models; pseudo spectra may not capture all experimental artifacts, instrumental noise, or compound-specific ionization effects observed in real LC–QTOF or other MS data.
- Coverage is limited by the chemical scope of CFM-ID's training; highly novel or exotic structures may produce unreliable spectra.
- Models trained solely on pseudo data may exhibit domain shift when applied to experimental spectra from different instruments or ionization methods; real validation data (300+ spectra in this study) is essential to assess generalization.
- The README notes a prior data link failure; ensure SMILES input files are accessible and properly formatted before running large batch generation.
Evidence
- [other] For each SMILES string, invoke CFM-ID to generate in silico mass spectra with fragmentation patterns.: "For each SMILES string, invoke CFM-ID to generate in silico mass spectra with fragmentation patterns."
- [other] Pair each input SMILES with its corresponding CFM-ID-generated spectrum to create pseudo SMILES-spectrum pairs.: "Pair each input SMILES with its corresponding CFM-ID-generated spectrum to create pseudo SMILES-spectrum pairs."
- [readme] For Training, we use 30k+ pseudo smiles-specturm pairs generated by cfmid: "For Training, we use 30k+ pseudo smiles-specturm pairs generated by cfmid"
- [intro] Training data for MSGO consists of 30k+ pseudo SMILES-spectrum pairs generated by CFM-ID from raw SMILES lists.: "Training data for MSGO consists of 30k+ pseudo SMILES-spectrum pairs generated by CFM-ID from raw SMILES lists."
- [other] Validate that the output file contains the expected number of pairs and that each pair includes both a valid SMILES string and a corresponding spectrum representation.: "Validate that the output file contains the expected number of pairs and that each pair includes both a valid SMILES string and a corresponding spectrum representation."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.