Virtual mass spectrometer configuration
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill virtual-mass-spectrometer-configurationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 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 author says it does
Copied from the file, not written here
Use when when you have generated or extracted a chemical mixture (via DatabaseFormulaSampler, ChemicalMixtureCreator, or ChemicalMixtureFromMZML) and need to establish a virtual instrument to simulate scan acquisition.
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
7.9 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Virtual Mass Spectrometer Configuration
Summary
Configure an IndependentMassSpectrometer instance with ionization polarity and chemical mixture composition to enable realistic full-scan or tandem MS acquisition simulation. This is the foundational step for prototyping fragmentation strategies in ViMMS before testing on real LC-MS/MS hardware.
When to use
When you have generated or extracted a chemical mixture (via DatabaseFormulaSampler, ChemicalMixtureCreator, or ChemicalMixtureFromMZML) and need to establish a virtual instrument to simulate scan acquisition. Specifically: use this skill when you are ready to move from chemical definition to instrument simulation, and before you instantiate a controller (e.g., FullScanController, TopNController) and Environment loop.
When NOT to use
- You have not yet defined or extracted a chemical mixture—define chemicals first using DatabaseFormulaSampler or ChemicalMixtureFromMZML.
- You intend only to analyze or reprocess real experimental mzML data without simulation—use direct mzML parsing tools instead.
- Your chemicals lack defined fragmentation parameters or retention time ranges—the mass spectrometer requires these to generate realistic scans.
Inputs
- ChemicalMixtureCreator instance (with ms_levels and retention time range defined)
- ChemicalMixtureFromMZML instance (ROIs extracted from real mzML with MS levels ≥ 2)
- Ionization polarity flag (positive or negative mode)
Outputs
- IndependentMassSpectrometer object (ready for Environment instantiation)
- Virtual instrument configured with supplied chemicals and ionization state
How to apply
Instantiate an IndependentMassSpectrometer with your prepared chemical mixture and specify the ionization polarity (positive or negative). The mass spectrometer object serves as the scanning engine that will generate realistic MS1 and MS2 spectra based on the fragmentation parameters of the supplied chemicals. Set the polarity according to your experimental design—beer or HMDB metabolite samples are typically analyzed in positive mode. The mass spectrometer is then passed to an Environment instance (along with a chosen controller) to execute the acquisition loop. Validation occurs at runtime: confirm that the mass spectrometer generates scans with expected m/z ranges (e.g., 100–1000 for HMDB sampling) and realistic intensity distributions matching the input chemical composition.
Related tools
- ViMMS (Framework providing IndependentMassSpectrometer class and acquisition environment simulation) — https://github.com/glasgowcompbio/vimms
- ChemicalMixtureCreator (Generates chemical mixture input for mass spectrometer configuration) — https://github.com/glasgowcompbio/vimms
- ChemicalMixtureFromMZML (Extracts ROI-based UnknownChemical objects from real mzML to supply to mass spectrometer) — https://github.com/glasgowcompbio/vimms
- DatabaseFormulaSampler (Samples molecular formulas from HMDB to seed ChemicalMixtureCreator input) — https://github.com/glasgowcompbio/vimms
- Environment (Receives configured mass spectrometer and controller; orchestrates acquisition loop) — https://github.com/glasgowcompbio/vimms
Examples
from vimms.MassSpec import IndependentMassSpectrometer; from vimms.Chemicals import ChemicalMixtureCreator; chemicals = ChemicalMixtureCreator(num_chemicals=100, ms_levels=2); ms = IndependentMassSpectrometer(chemicals, polarity='positive'); env = Environment(ms, controller, min_rt=0, max_rt=1440); env.run(); env.write_mzML('simulated_output.mzML')
Evaluation signals
- Mass spectrometer object instantiates without error and retains reference to all supplied chemicals
- Output scans generated by Environment.run() span the expected m/z range (e.g., 100–1000 for HMDB samples)
- MS1 and MS2 spectra intensity distributions and fragmentation patterns match the chemical mixture composition (e.g., correct precursor m/z, expected fragment masses)
- Scans written to mzML via Environment.write_mzML() are structurally valid and parseable by external tools
- Ionization polarity is correctly reflected in written scans (positive or negative m/z values and ion counts)
Limitations
- Mass spectrometer simulation assumes fragmentation parameters are accurate; incorrect chemical definitions or retention time windows will produce unrealistic scans.
- The simulator does not model detector saturation or mass calibration drift observed in real hardware; it provides idealized baseline performance.
- Performance scales with chemical mixture size; very large mixtures (e.g., >100k chemicals) may incur long Environment.run() times.
- Polarity setting is fixed at configuration time; switching polarities requires instantiating a new IndependentMassSpectrometer.
Evidence
- [other] Instantiate an IndependentMassSpectrometer in positive ionization mode with the extracted chemicals: "Instantiate an IndependentMassSpectrometer in positive ionization mode with the extracted chemicals."
- [other] Use ChemicalMixtureCreator to generate a chemical mixture with ms_levels=1 (MS1 only): "Use ChemicalMixtureCreator to generate a chemical mixture with ms_levels=1 (MS1 only)."
- [readme] a flexible and modular framework designed to simulate fragmentation strategies: "a flexible and modular framework designed to simulate fragmentation strategies in tandem mass spectrometry-based metabolomics."
- [other] Create an Environment instance with the mass spectrometer, controller, and retention time range: "Create an Environment instance with the mass spectrometer, controller, and retention time range (e.g., min_rt=0, max_rt=1440)."
- [readme] You can generate new LC-MS/MS data based on empirical data or virtually replay a previous LC-MS/MS analysis using existing data: "You can generate new LC-MS/MS data based on empirical data or virtually replay a previous LC-MS/MS analysis using existing data, which allows for testing different fragmentation strategies."