agentsclimarketplace

Smiles mol file parsing

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/smiles-mol-file-parsing

Use when when you have molecular structures encoded as SMILES strings or MOL files from an in-house database or spectroscopy repository, and need to convert them into node-edge graph representations with explicit atom features (atomic number, degree, formal charge, hybridization) and bond features.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill smiles-mol-file-parsing

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

SMILES and MOL file parsing for molecular graph construction

Summary

Parse molecular structure data from SMILES strings or MOL files using RDKit to extract atom and bond features, enabling conversion into node-edge graph representations suitable for GNN input. This skill is essential for preparing chemical structure data from spectroscopy databases into machine-learning-ready formats.

When to use

When you have molecular structures encoded as SMILES strings or MOL files from an in-house database or spectroscopy repository, and need to convert them into node-edge graph representations with explicit atom features (atomic number, degree, formal charge, hybridization) and bond features (bond type, aromaticity) for training graph neural networks like GNN-RT.

When NOT to use

  • Input is already in node-edge graph format or precomputed feature tensors — skip directly to GNN training.
  • Molecular structures are incomplete, contain unspecified stereochemistry critical to your analysis, or lack proper atom valence validation.
  • Input files are malformed SMILES (e.g., unbalanced parentheses) or corrupted MOL files that RDKit cannot parse without manual curation.

Inputs

  • SMILES strings from in-house molecular database
  • MOL format files from spectroscopy data repositories
  • Spectra files containing encoded molecular structures

Outputs

  • Molecular graphs with node-edge representation
  • Atom feature arrays (atomic number, degree, formal charge, hybridization)
  • Bond feature arrays (bond type, aromaticity)
  • Serialized graph objects (pickle or HDF5 format) compatible with PyTorch DataLoader

How to apply

Load molecular structure files (SMILES or MOL format) from the database using RDKit's molecular parsing functions. For each structure, construct a molecular graph by converting it into a node-edge representation with atom features (atomic number, degree, formal charge, hybridization) and bond features (bond type, aromaticity) using RDKit's graph construction methods. Validate that all features are correctly extracted and non-null. Serialize the resulting graph objects into a format compatible with PyTorch's DataLoader (e.g., pickle or HDF5) for downstream consumption by the GNN training pipeline. The rationale is that RDKit's native graph representation captures the full chemical topology needed for end-to-end GNN learning to predict molecular properties like LC retention time.

Related tools

  • RDKit (Parse SMILES and MOL files; construct molecular graphs with atom/bond feature extraction and graph serialization) — https://www.rdkit.org/
  • PyTorch (Serialize and load molecular graphs via DataLoader for GNN training pipeline compatibility)
  • Python (Scripting environment (Anaconda 3.6+) for orchestrating RDKit and PyTorch operations)

Examples

python Preprocess.py

Evaluation signals

  • All SMILES/MOL inputs parse without errors; RDKit returns valid molecule objects for ≥95% of input records.
  • Atom feature arrays contain no NaN or None values; atomic numbers, degrees, formal charges, and hybridization states are in chemically valid ranges.
  • Bond feature arrays correctly reflect bond types (single, double, triple, aromatic) and aromaticity labels matching chemical structure.
  • Serialized graph objects can be successfully deserialized by PyTorch DataLoader without shape/type mismatches during GNN training.
  • Graph feature counts match downstream GNN input layer expectations (e.g., node feature dimension matches concatenated atom features; edge features match bond feature dimension).

Limitations

  • RDKit parsing may fail on non-standard or malformed SMILES strings; validation and error handling are required.
  • MOL file format variation (MOL vs. MOL2 vs. SDF) may require format-specific parsers; the skill assumes standard V2000/V3000 MOL format.
  • Stereochemistry, isotopes, and formal charges must be explicitly encoded in SMILES or MOL files; implicit hydrogens and 2D coordinates in MOL files may cause feature extraction discrepancies.
  • No explicit changelog or version pinning guidance provided in the repository, so RDKit API stability across versions is not guaranteed.

Evidence

  • [other] Load molecular structure data (SMILES or MOL format) from the in-house database using RDKit. Construct molecular graphs by converting each structure into a node-edge representation with atom features (atomic number, degree, formal charge, hybridization) and bond features (bond type, aromaticity) using RDKit's graph construction methods.: "Load molecular structure data (SMILES or MOL format) from the in-house database using RDKit. Construct molecular graphs by converting each structure into a node-edge representation with atom features"
  • [other] Serialize the molecular graphs into a format compatible with PyTorch's DataLoader (e.g., pickle or HDF5) for consumption by the GNN training pipeline.: "Serialize the molecular graphs into a format compatible with PyTorch's DataLoader (e.g., pickle or HDF5) for consumption by the GNN training pipeline."
  • [readme] put your spectra files in to data directory and run [Preprocess.py]: "put your spectra files in to data directory and run [Preprocess.py]"
  • [readme] It takes molecular graph as the input, and the predicted retention time as the output.: "It takes molecular graph as the input, and the predicted retention time as the output."

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.