Metadata-Version: 2.2
Name: rdkit-montai
Version: 1.0.1
Summary: RDKit fork with enhanced stereochemistry InChI support
Keywords: chemistry,cheminformatics,rdkit,inchi,stereochemistry
Author: Montai Therapeutics
License: BSD-3-Clause
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Chemistry
Project-URL: Repository, https://github.com/fl65inc/rdkit-montai
Requires-Python: <3.13,>=3.12
Requires-Dist: numpy>=1.25
Description-Content-Type: text/markdown

# rdkit-montai

Fork of [RDKit](https://github.com/rdkit/rdkit) 2026.03.1pre with **enhanced stereochemistry InChI support**.

## Install

Pre-built wheels for Linux (x86_64, aarch64) and macOS (ARM):

```bash
pip install rdkit-montai
```

## What's different from upstream RDKit?

Upstream RDKit silently drops enhanced stereo group annotations (ABS, OR, AND) during InChI generation. This means a racemic mixture and a single enantiomer produce **identical InChI Keys** — they are indistinguishable.

This fork fixes that:

- **Mol → InChI:** Stereo groups (ABS/OR/AND) are passed to the InChI library via the `GetINCHIEx` extended API, producing a `/s` layer that encodes the stereo group type
- **InChI → Mol:** The `/s` layer is parsed back into `StereoGroup` objects, so round-trips preserve stereo annotations
- **Stable keys:** Enhanced stereo InChIs produce standard `InChI=1S/` output (not Beta `1B`), so keys will match the eventual official IUPAC release
- **InChI v1.07.5:** Upgraded from v1.05 (2017) to the [IUPAC-InChI](https://github.com/IUPAC-InChI/InChI) dev branch with enhanced stereochemistry support

| Group Type | Meaning | InChI `/s` prefix |
|---|---|---|
| **ABS** | Absolute configuration | `1(...)` |
| **OR** | This enantiomer or its mirror | `2(...)` |
| **AND** | Racemic mixture | `3(...)` |

## Usage

```python
from rdkit import Chem
from rdkit.Chem.inchi import MolToInchi, MolFromInchi

# Create a molecule with an AND stereo group (racemic)
mol = Chem.MolFromSmiles('[C@@H](F)(Cl)Br |&1:0|')

# Generate InChI — stereo group is preserved in /s layer
inchi = MolToInchi(mol)
print(inchi)  # Contains /s3(...) for AND group

# Round-trip back — stereo group is restored
mol2 = MolFromInchi(inchi)
groups = mol2.GetStereoGroups()
print(len(groups))  # 1
```

### Preserving atom order with AuxInfo

```python
from rdkit.Chem.inchi import MolToInchiAndAuxInfo, MolFromInchiAndAuxInfo

mol = Chem.MolFromSmiles('c1cc(O)ccc1N')
inchi, aux = MolToInchiAndAuxInfo(mol)
mol2 = MolFromInchiAndAuxInfo(inchi, aux)
# Atom order and coordinates are preserved
```

## Upstream status

| Change | Upstream PR | Status |
|---|---|---|
| `MolFromInchiAndAuxInfo` | [rdkit/rdkit #9158](https://github.com/rdkit/rdkit/pull/9158) | Merged into rdkit:main |
| Enhanced stereo InChI | — | Not yet submitted (waiting for IUPAC official release) |
| InChI v1.07 upgrade | — | Depends on IUPAC official release |

**Base commit:** RDKit 2026.03.1pre ([`22be7245d`](https://github.com/rdkit/rdkit/commit/22be7245d))

## License

Code released under the [BSD license](https://github.com/rdkit/rdkit/blob/master/license.txt).
