Skip to content

Extend RDKit converter with InChI and InChIKey conversions#180

Merged
hechth merged 9 commits into
mainfrom
copilot/extend-rdkit-conversions
Jun 8, 2026
Merged

Extend RDKit converter with InChI and InChIKey conversions#180
hechth merged 9 commits into
mainfrom
copilot/extend-rdkit-conversions

Conversation

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Adds offline (compute) conversion routes to the RDKit converter for InChI and InChIKey derivation from SMILES and InChI inputs.

New conversions

  • canonical_smiles / isomeric_smilesinchi — via MolToInchi
  • canonical_smiles / isomeric_smilesinchikey — via MolToInchi + InchiToInchiKey
  • inchiinchikey — via InchiToInchiKey
  • smilesinchi / inchikey — auto-discovered via naming convention

Implementation notes

  • smiles_to_inchi and smiles_to_inchikey are registered in the conversions list for canonical_smiles/isomeric_smiles variants; inchi_to_inchikey uses the _to_ naming convention for auto-discovery and is intentionally not registered dynamically (doing so would shadow the class method, causing infinite recursion).
  • Both smiles_to_inchikey and inchi_to_inchikey guard against empty/None intermediate values before calling InchiToInchiKey.
rdkit = RDKit()
rdkit.isomeric_smiles_to_inchi("C[C@H](O)c1ccccc1")
# → {"inchi": "InChI=1S/C8H10O/c1-7(9)8-5-3-2-4-6-8/h2-7,9H,1H3/t7-/m1/s1"}

rdkit.inchi_to_inchikey("InChI=1S/C8H10O/...")
# → {"inchikey": "RWMIMWHPCEFZSA-SCSAIBSYSA-N"}

Note: smiles → iupac_name is not implemented here — RDKit has no native IUPAC name generation. The annotation pipeline can already chain smiles → inchi (RDKit) + inchi → iupac_name (IDSM/PubChem) to cover that path.

Copilot AI linked an issue Jun 2, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Extend RDKit conversions to include additional formats Extend RDKit converter with InChI and InChIKey conversions Jun 2, 2026
Copilot finished work on behalf of hechth June 2, 2026 08:29
Copilot AI requested a review from hechth June 2, 2026 08:29
@hechth

hechth commented Jun 2, 2026

Copy link
Copy Markdown
Member

@copilot please also update the changelog accordingly

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please also update the changelog accordingly

Done — updated the changelog in commit Update changelog for RDKit InChI/InChIKey conversions to add the new conversions under the [0.5.1] entry.

Copilot finished work on behalf of hechth June 2, 2026 09:08
@hechth hechth marked this pull request as ready for review June 5, 2026 12:40
@hechth hechth merged commit 460a911 into main Jun 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend RDKit conversions

2 participants