Calculating CIP for chiral centers with three drawn bonds
- 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:

3. Select Calculate CIP'
**Actual behavior**
Ketcher calculates CIP

**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.

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