agentsclimarketplace

Spectral data input handling mgf format

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/spectral-data-input-handling-mgf-format

Use when when you have raw MS/MS mass spectrometry data and need to submit it to the Mass2SMILES Docker inference container for structure and functional group prediction.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill spectral-data-input-handling-mgf-format

Assembled 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.2 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

spectral-data-input-handling-mgf-format

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

Summary

Prepare and validate MS/MS spectral data in GNPS-style MGF format for input to the Mass2SMILES deep learning model. This skill ensures that raw mass spectrometry data is correctly formatted and accessible to the inference pipeline before structure prediction begins.

When to use

When you have raw MS/MS mass spectrometry data and need to submit it to the Mass2SMILES Docker inference container for structure and functional group prediction. Use this skill if your spectra are currently in MGF (mascot generic format) adhering to GNPS conventions, or if you need to convert or validate existing spectral data into that format.

When NOT to use

  • Input is already in a non-MGF proprietary vendor format (e.g., raw Thermo .raw, Agilent .d) without conversion to MGF first.
  • Spectral data is already processed as a feature matrix or embedding and does not need to be re-parsed from raw MGF.
  • You need only to retrieve metadata about spectra without performing inference; MGF parsing is unnecessary overhead in that case.

Inputs

  • MGF file (GNPS-style format) containing MS/MS spectral data with precursor m/z and fragment ion peaks

Outputs

  • Parsed spectral data tensor ready for model inference
  • Validated MGF metadata and peak lists

How to apply

Obtain or prepare your MS/MS spectral data as a GNPS-style MGF file, which is the native input format accepted by Mass2SMILES. Mount the directory containing your MGF file to the Mass2SMILES Docker container at runtime (using -v flag) so the container can access it. Verify that the MGF file is properly formatted by checking for required GNPS-style headers and m/z–intensity pairs. Pass the MGF filename as an argument to the mass2smiles_transformer.py script running inside the container, along with the output directory path. The container will parse the spectral data, prepare it as input tensors for the transformer model, and generate SMILES predictions.

Related tools

  • Docker (Container runtime that isolates and executes the Mass2SMILES inference pipeline with mounted volume access to MGF input files)
  • mass2smiles_transformer.py (Python script that accepts MGF filename as argument and orchestrates parsing, tensor conversion, and model inference) — https://github.com/volvox292/mass2smiles
  • delser292/mass2smiles:final (Pre-built Docker image containing the Mass2SMILES model, dependencies, and inference scripts; accepts MGF input via mounted volume) — https://hub.docker.com/r/delser292/mass2smiles

Examples

docker run -v /path/to/mass2smiles:/app delser292/mass2smiles:final conda run -n tf python app/mass2smiles_transformer.py sample_spectra.mgf /app

Evaluation signals

  • MGF file is successfully mounted to the container and readable at the specified mount path.
  • The mass2smiles_transformer.py script completes without file-not-found or format parsing errors.
  • The container's standard output or log file confirms that spectral peaks and precursor m/z values were extracted and parsed from the MGF.
  • Output SMILES predictions are generated in the specified output directory, confirming that the input spectral tensors were successfully created and passed through the model.
  • No warnings or exceptions related to malformed MGF headers, missing required fields, or corrupted peak lists appear in the container logs.

Limitations

  • Only GNPS-style MGF format is supported; other spectral file formats (e.g., mzML, mzXML, vendor raw formats) must be converted to MGF externally before use with Mass2SMILES.
  • The inference container requires Docker to be installed and the user must have permission to mount volumes and run containers; local file access depends on correct -v flag syntax for the user's operating system.
  • Large MGF files or files with very high-resolution spectra may require substantial memory or CPU resources during tensor conversion, depending on the cpu_threads parameter configured in the InferenceModel.

Evidence

  • [intro] Spectral data input as MGF files (GNPS-style): "Spectral data can be provided as MGF files (GNPS-syle)"
  • [intro] Model inference via Docker container with volume mounting: "model inference is most effciently performed via the provided docker container"
  • [readme] Docker run command with volume mount for MGF input and output directory: "docker run -v c:/your_path/to_the_folder/mass2smiles/:/app mass2smiles:transformer_v1 conda run -n tf python app/mass2smiles_transformer.py your_mgf_file.mgf /app"
  • [readme] Mass2SMILES is an open-source Python based deep learning approach for structure and functional group prediction from mass spectrometry data (MS/MS): "Mass2SMILES is an open-source Python based deep learning approach for structure and functional group prediction from mass spectrometry data (MS/MS)"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.