agentsclimarketplace

Smiles canonicalization rdkit

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/smiles-canonicalization-rdkit

Use when when preprocessing raw SMILES strings from external chemistry databases (e.g., CCSBase, METLIN-CCS, or custom compound libraries) that may contain multiple valid but non-canonical notations for the same molecular structure.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill smiles-canonicalization-rdkit

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

5.2 KB, 872 tokens by cl100k_base, as published. Nobody here has run it

SMILES canonicalization with RDKit

Summary

Standardize SMILES string representations of chemical structures using RDKit to ensure structural consistency before converting to graph representations for machine learning. This step eliminates notation variants and ambiguities that could otherwise produce different graph features from chemically identical molecules.

When to use

When preprocessing raw SMILES strings from external chemistry databases (e.g., CCSBase, METLIN-CCS, or custom compound libraries) that may contain multiple valid but non-canonical notations for the same molecular structure. Apply this before constructing molecular graphs for GNN input to ensure that identical chemicals always produce identical feature tensors regardless of how they were originally notated.

When NOT to use

  • SMILES strings are already known to be canonicalized or from a single standardized source.
  • The analysis requires preservation of the original notation (e.g., for notation bias studies).
  • Input is not in SMILES format (e.g., InChI, molecular formula, or structure image).

Inputs

  • Raw SMILES strings (CSV, Excel, or Parquet column)
  • Column name or file path specifying the SMILES field
  • Optional: molecular validity threshold or error handling strategy

Outputs

  • Canonical SMILES strings (one per molecule)
  • Validity log or report (fraction parsed successfully, rejected SMILES)

How to apply

Load raw SMILES strings from the input dataset (typically a CSV, Excel, or Parquet file with a designated SMILES column). For each SMILES string, use RDKit's canonicalization function to convert it to a unique, standardized form that represents the same molecular structure unambiguously. Verify that canonicalization does not reject the input (i.e., RDKit successfully parses it as a valid molecule); invalid SMILES should be logged and filtered. The canonicalized SMILES output becomes the input for the next step (molecular graph construction). This preprocessing ensures that downstream graph representations and GNN predictions are deterministic and comparable across different data sources or notational variations.

Related tools

Examples

from rdkit import Chem; canonical_smiles = Chem.MolToSmiles(Chem.MolFromSmiles('CCO'))

Evaluation signals

  • All input SMILES strings are successfully parsed by RDKit; log parsing errors and rejection rate.
  • Canonical SMILES are deterministic: running canonicalization twice on the same input produces identical output.
  • Equivalent molecules notated differently (e.g., CCO vs OCC for ethanol) map to the same canonical form.
  • Canonical SMILES are valid input to downstream molecular graph construction (no errors in bond/atom feature extraction).
  • Canonical SMILES are shorter or equal in length to originals (canonical form removes redundant notation).

Limitations

  • RDKit's canonicalization may fail on unusual or malformed SMILES; invalid structures must be filtered before graph construction.
  • Canonicalization does not validate chemical plausibility or detect stereoisomers; stereochemistry must be explicitly encoded in SMILES.
  • Different RDKit versions may produce slightly different canonical forms; reproducibility requires fixing the RDKit version.
  • Very large SMILES strings or highly complex structures may be slow to canonicalize; performance depends on molecular complexity.

Evidence

  • [other] Canonicalize SMILES using RDKit to ensure structural consistency.: "Canonicalize SMILES using RDKit to ensure structural consistency."
  • [readme] Each user should download the raw database (as excel/csv) and read them in the two notebooks for each database located at https://github.com/enveda/ccs-prediction/tree/main/notebooks/data_processing.: "Each user should download the raw database (as excel/csv) and read them in the two notebooks for each database"
  • [other] Convert each canonical SMILES to a molecular graph representation with atom and bond features.: "Convert each canonical SMILES to a molecular graph representation with atom and bond features."

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.