Rody Arantes 5d9892575c Fix STEREOANY (wavy bond) loss during InChI roundtrip (#9315)
When converting molecules with wavy bonds (Bond::STEREOANY on double
bonds) through InChI and back, the stereo information was silently
dropped. This affected any workflow using InChI roundtrips for
canonicalization (e.g. with -SUU flag).

Two bugs in External/INCHI-API/inchi.cpp:

Reverse path (InchiToMol): The stereo0D processing loop skipped
INCHI_PARITY_UNDEFINED entries before they could reach the double bond
handler. The handler already had an else clause that correctly sets
Bond::STEREOANY, but it was never reached. Fix: only skip
INCHI_PARITY_NONE at the top level, and add a guard in the Tetrahedral
case to prevent UNDEFINED/UNKNOWN from incorrectly setting chirality.

Forward path (MolToInchi): STEREOANY double bonds were only handled by
collapsing the coordinates — InChI then produced no stereo annotation
under -SUU. Fix: also emit a stereo0D entry with INCHI_PARITY_UNKNOWN
parity so InChI's -SUU output correctly carries the "stereo unknown"
designation. StereoAtoms may be cleared for STEREOANY, so we locate
the two outer neighbors by iterating bonds.

New test testStereoAnyRoundtrip in External/INCHI-API/test.cpp covers
9 representative cases (Schiff base, oxime, cinnamic acid, chalcone,
crotonaldehyde, tamoxifen-like, retinal-like, plus two molecules with
a chiral center adjacent to the wavy bond).

Counts in rdkit/Chem/UnitTestInchi.py shift by 1 (689 same, 492
reasonable) because the new STEREOANY emission produces a more
accurate roundtrip for one entry in the test inventory.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-02 14:41:00 +02:00
2024-08-16 17:11:31 +02:00
2026-05-06 06:10:37 +02:00
2020-04-17 17:48:58 +02:00
2015-11-26 02:34:33 +01:00
2016-09-23 04:58:46 +02:00

RDKit

Azure build Status DOI

What is it?

The RDKit is a collection of cheminformatics and machine-learning software written in C++ and Python.

  • BSD license - a business friendly license for open source
  • Core data structures and algorithms in C++
  • Python 3.x wrapper generated using Boost.Python
  • Java and C# wrappers generated with SWIG
  • JavaScript (generated with emscripten) and CFFI wrappers around important functionality
  • 2D and 3D molecular operations
  • Descriptor and Fingerprint generation for machine learning
  • Molecular database cartridge for PostgreSQL supporting substructure and similarity searches as well as many descriptor calculators
  • Cheminformatics nodes for KNIME
  • Contrib folder with useful community-contributed software harnessing the power of the RDKit

Installation and getting started

If you are working in Python and using conda (our recommendation), installation is super easy:

$ conda install -c conda-forge rdkit

You can then take a look at our Getting Started in Python guide.

More detailed installation instructions are available in Docs/Book/Install.md.

Documentation

Available on the RDKit page and in the Docs folder on GitHub

The RDKit blog often has useful tips and tricks.

Support and Community

If you have questions, comments, or suggestions, the best places for those are:

If you've found a bug or would like to request a feature, please create an issue

We also have a LinkedIn group

We have a yearly user group meeting (the UGM) where members of the community do presentations and lightning talks on things they've done with the RDKit. Materials from past UGMs, which can quite useful, are also online:

License

Code released under the BSD license.

Description
No description provided
Readme 380 MiB
Languages
C++ 69.6%
Python 15.3%
PLSQL 3.6%
CMake 2.8%
C 2.5%
Other 6.1%