epam / epam/Indigo

Calculating CIP for chiral centers with three drawn bonds

Open
#2,674 0 comments 0 reactions 0 assignees View on GitHub
Ljubica found bugs Priority: Medium Severity: High
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

**Steps to Reproduce**
1. Go to Ketcher micromolecules mode
2. Draw any structure with an atom that has three bonds, where only one is a stereo-bond. For example:
![image](https://github.com/epam/Indigo/assets/169887211/d4c8615d-ae91-4d47-bfb0-1605f2d88445)
3. Select Calculate CIP'

**Actual behavior**

Ketcher calculates CIP
![image](https://github.com/epam/Indigo/assets/169887211/fe311b5a-88a4-49d0-828c-c1f9fe18b6be)

**Expected behavior**

Ketcher should calculate CIP for an atom with three drawn bonds only if all the conditions are met:
1. The atom can be a chiral center. Related issue [#4755](https://github.com/epam/Indigo/issues/2679)
2. The atom is four-valent.
3. The atom has three drawn bonds with different groups (none of them hydrogen).
4. Only one of the drawn bonds is an up or a down bond.

In this case the fourth bond is an implied bond with hydrogen, where the hydrogen is of the opposite orientation to the drawn stereo-bond.
![image](https://github.com/epam/Indigo/assets/169887211/66080c5b-6ad9-4087-ab2c-86165709657e)
That is why it is important for the chiral center to be four-valent. If it is, for example, three-valent, there would be no implied hydrogen. Or if it was five-valent, there would be two implied hydrogens.

**Ketcher version v2.22.0**

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the case in Ketcher micromolecules mode by drawing a three-bond atom with one up or down bond, then follow the Calculate CIP entry point into the CIP calculation code. Verify handling of valence, distinct non-hydrogen groups, and the single stereo-bond condition; done means invalid centers are rejected and valid four-valent centers with an implied hydrogen receive the correct CIP result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.