epam / epam/Indigo

Tautomers strict mode

Open
#3,435 0 comments 0 reactions 1 assignee Claimed by @even1024 View on GitHub
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

**Background**

The current tautomer matching logic controls *which* atoms can participate in tautomerism via indigoSetTautomerRule. However, these rules primarily define topological connectivity limits and do not validate the *chemical environment* or "activation" required for such transformations. This leads to False Positives where tautomerism is topologically possible but chemically invalid, such as unactivated hydrocarbon shifts.

**Solution**

Introduced a`STRICT` keyword for Tautomer matching (e.g., `"TAU STRICT"`).
This mode serves as an additional validation layer. When enabled, it strictly enforces that any Carbon atom participating in a tautomeric shift must be **chemically activated** by an electron-withdrawing Heteroatom (**O, N, S, P**).

**Rules**

The validation logic uses a Depth-First Search (DFS) trace to verify the electronic path:

1. **Direct Activation:**
The Carbon atom is directly bonded to an activating Heteroatom (**O, N, S, P**). (Path length = 1 bond).
* *Applies to:* Enols (`C=C-OH`), Imines.

2. **Conjugated (Vinylogous) Activation:**
The Carbon atom is connected to an activating Heteroatom (**O, N, S, P**) through a continuous path of **alternating bonds** (Single $\leftrightarrow$ Double/Triple).
* *Mechanism:* The alternating $\pi$-system acts as a conductive wire, allowing the Heteroatom's electron-withdrawing effect to transmit to distant carbons ($\gamma, \epsilon$ positions).
> Image

**Examples & Logic Table**

| Case Name | Structure Example | Status | Reason |
| :--- | :--- | :--- | :--- |
| **Standard Keto** | `H-C-C=O` | **PASS** | **Valid.** Path is `Single` $\to$ [Double](cci:1://file:///Users/drwho/source/Indigo/core/indigo-core/molecule/molecule_tautomer.h:287:8-287:77) $\to$ `O`. Effect reaches carbon. |
| **Enol** | `C=C-OH` | **PASS** | **Valid.** Direct connection to Oxygen. |
| **Vinylogous** | `H-C-C=C-C=O` | **PASS** | **Valid.** Alternating bonds transmit activation to distal carbon. |
| **Aromatic** | `H-C-Ph-C=O` | **PASS** | **Valid.** Aromatic ring conducts resonance effect. |
| **Hydrocarbon** | `C-C=C-C` | **FAIL** | **Invalid.** No Heteroatom anchor. Pure alkyl shift. |
| **Broken Path** | `O=C-CH2-CH=C` | **FAIL** | **Invalid.** Path broken by `sp3` (`-CH2-`) linkage. Resonance cut. |
| **Isolated Ether** | `O-CH2-CH=C` | **FAIL** | **Invalid.** Oxygen isolated by single bonds. No resonance interaction. |

**Technical Implementation**
* **Logic:** Implemented `TautomerMatcher::isTautomerActivatedCarbon` using the trace algorithm.
* **Flags:** Updated [parseConditions](cci:1://file:///Users/drwho/source/Indigo/core/indigo-core/molecule/src/molecule_tautomer_matcher.cpp:143:0-224:1) to interpret `TAU STRICT` correctly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.