agentsclimarketplace

Rdkit molecular descriptor computation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/rdkit-molecular-descriptor-computation

Use when when annotating .msp mass spectrometry files with chemical structure metadata and you need fast, offline molecular transformations (SMILES↔InChI, canonical SMILES generation) without network latency or service availability constraints;From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill rdkit-molecular-descriptor-computation

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

7.7 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

rdkit-molecular-descriptor-computation

Summary

Implement a local ComputeConverter subclass using RDKit to perform chemical structure conversions (e.g., SMILES to InChI) on mass spectrometry metadata without relying on external web services. This skill enables offline, deterministic molecular property computation integrated into the MSMetaEnhancer annotation pipeline.

When to use

When annotating .msp mass spectrometry files with chemical structure metadata and you need fast, offline molecular transformations (SMILES↔InChI, canonical SMILES generation) without network latency or service availability constraints; particularly useful when processing large batches of spectra that require consistent, reproducible structure conversions.

When NOT to use

  • Input structures require validation against external reference services or you need confidence scores for conversions.
  • You need stereoisomeric SMILES variants (ISOMERIC_SMILES or CANONICAL_SMILES from PubChem) that require web service lookup.
  • The converter must support asynchronous batch processing with dynamic retry logic for failed conversions.

Inputs

  • SMILES strings (or other chemical structure formats supported by RDKit)
  • Converter configuration (source and target chemical attribute names)
  • Molecular structure objects (RDKit Mol objects from parsed input)

Outputs

  • InChI strings
  • InChI keys
  • Canonical SMILES
  • Molecular formulas
  • Converted metadata dictionaries keyed by target attribute names

How to apply

Create a new Python file inheriting from ComputeConverter in MSMetaEnhancer/libs/converters/compute/ that defines a conversions list with source and target attributes (e.g., 'smiles' to 'inchi') and calls create_top_level_conversion_methods with asynch=False. Implement conversion methods using RDKit's Chem module (e.g., RDKit Chem.MolFromSmiles to parse SMILES strings and Chem.inchi.MolToInchi to generate InChI). Return converted data as a dictionary with target attribute keys. Register the converter in MSMetaEnhancer/libs/converters/compute/init.py by importing and adding to all. Write pytest tests validating converter instantiation and conversion accuracy against reference SMILES inputs, then run pytest to confirm existing tests pass and new converter executes successfully.

Related tools

  • RDKit (Core cheminformatics library for local molecular structure parsing, validation, and conversion (SMILES→InChI, canonical SMILES generation))
  • MSMetaEnhancer (Parent framework providing ComputeConverter base class, converter registration, and async annotation orchestration for .msp files) — https://github.com/RECETOX/MSMetaEnhancer
  • pytest (Test framework for validating converter instantiation, conversion accuracy against reference inputs, and regression testing of existing converters)
  • Python (Implementation language for ComputeConverter subclass and integration with MSMetaEnhancer async pipeline)

Examples

from MSMetaEnhancer.libs.converters.compute import RDKit
from MSMetaEnhancer.libs.utils.ConverterBuilder import ConverterBuilder
ConverterBuilder.register([RDKit])
app = Application()
app.load_data('sample.msp', file_format='msp')
jobs = [('smiles', 'inchi', 'RDKit'), ('smiles', 'inchikey', 'RDKit')]
import asyncio
asyncio.run(app.annotate_spectra(['RDKit'], jobs))

Evaluation signals

  • Converter instantiates without errors and is registered in all and importable from MSMetaEnhancer.libs.converters.compute
  • Conversion methods correctly parse valid SMILES strings and produce chemically valid output (InChI, InChI keys, canonical SMILES) matching RDKit reference implementations
  • Pytest test suite passes for instantiation, conversion accuracy against known reference SMILES, and output structure (dictionary keys matching target attributes)
  • All existing MSMetaEnhancer tests continue to pass after converter registration (no regression)
  • Edge cases (invalid SMILES, None inputs, empty structures) are handled gracefully or raise appropriate exceptions, with behavior documented in test assertions

Limitations

  • RDKit local conversion does not provide alternative stereoisomeric SMILES representations or validate against external reference databases like PubChem.
  • Performance depends on RDKit's local computation speed; very large molecular structures or batches may be CPU-bound.
  • Conversion accuracy is limited to RDKit's chemical structure canonicalization rules; some specialized or unusual structures may not convert as expected.
  • Asynchronous execution (asynch=True) is not supported by ComputeConverter; this skill is inherently synchronous and may block the MSMetaEnhancer async pipeline if not carefully integrated.

Evidence

  • [other] ComputeConverter subclass using RDKit perform local chemical structure conversions (e.g., SMILES to InChI) without relying on web services: "ComputeConverter subclass using RDKit perform local chemical structure conversions (e.g., SMILES to InChI) without relying on web services"
  • [other] Create a new Python file in MSMetaEnhancer/libs/converters/compute/ that inherits from ComputeConverter: "Create a new Python file in MSMetaEnhancer/libs/converters/compute/ that inherits from ComputeConverter"
  • [other] Implement conversion methods using RDKit to perform local molecular structure transformations (e.g., parse SMILES strings with RDKit Chem.MolFromSmiles and generate InChI with Chem.inchi.MolToInchi): "Implement conversion methods using RDKit to perform local molecular structure transformations (e.g., parse SMILES strings with RDKit Chem.MolFromSmiles and generate InChI with Chem.inchi.MolToInchi)"
  • [other] Register the new converter in MSMetaEnhancer/libs/converters/compute/init.py by importing and adding to all: "Register the new converter in MSMetaEnhancer/libs/converters/compute/init.py by importing and adding to all"
  • [other] Create a pytest test file that validates converter instantiation and tests conversion accuracy against reference SMILES inputs, verifying output structure and chemical correctness: "Create a pytest test file that validates converter instantiation and tests conversion accuracy against reference SMILES inputs, verifying output structure and chemical correctness"
  • [readme] MSMetaEnhancer is a tool used for .msp files annotation. It adds metadata like SMILES, InChI, and CAS number: "MSMetaEnhancer is a tool used for .msp files annotation. It adds metadata like SMILES, InChI, and CAS number"
  • [other] Use the RDKit converter as a reference implementation: "Use the RDKit converter as a reference implementation"

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.