epam / epam/Indigo

Layout for structures that contain Markush and haptic bonds

Open
#3,767 0 comments 0 reactions 0 assignees View on GitHub
Draft
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

## Dictionary

**Markush bond** - A bond whose one endpoint is **one atom** from the attachment group. A markush bond can be any type besides haptic. The length of a Markush bond is 2 standard bond lengths.

> Markush bonds tickets: [Ketcher](https://github.com/epam/ketcher/issues/10305) & [Indigo](https://github.com/epam/Indigo/issues/3731).

**Haptic bond** - A bond whose one endpoint is **all atoms** from the attachment group. The length of a haptic bond is 1,5 standard bond lengths.

> Haptic bonds tickets: [Ketcher](https://github.com/epam/ketcher/issues/8390) & [Indigo](https://github.com/epam/Indigo/issues/3233).

**Attachment group** (AG) - A collection of atoms that make up an unknown endpoint (Markush) or a collective endpoint (haptic). The coordinates of the AG are xAG=(xmaxAG+xminAG)/2 and yAG=(ymaxAG+yminAG)/2.

**Central atom** - In case of AG-atom haptic bonds, a central atom is the atom bound to the AG.

**Ligand** - A structure whose atoms make up the AG. It can be cyclic or non-cyclic.

**Cyclic structure center** (CSC) - The center of the circular structure that participates in haptic bonding. The coordinates of the CSC are xCSC=(xmaxCYCLE+xminCYCLE)/2 and yCSC=(ymaxCYCLE+yminCYCLE)/2. Coordinates of CSC can, but **don't have to** match the coordinates of AG.

## Requirements

$\color{ProcessBlue}{\textbf{Layout for structures that contain Markush bonds and layout for haptic bonds with non-cyclic ligands}}$

1.1. The origin of the Markush/haptic bond is the AG.

1.2.1. The length of the Markush bond is 2 standard bond lengths.

1.2.2. The length of the haptic bond is 1,5 standard bond lengths.

1.3. Find the longest line between two points* within the AG. The angle between the Markush/hapic bond and the longest line should be 90°.

1.3.1. * Eligible points are AG atoms, or the centers of bonds between AG atoms.

1.4. If possible, chose the position that satisfies 1.3. and that does not intersect other bonds/atoms .

1.5. If the bond must intersect an atom/bond, chose a position that intersects a bond.

1.6. If multiple positions are remaining, chose one whose coordinate has the highest y value.

Expand for examples

Examples:

Image

There is 1 "longest lines" (per req. 1.3.)
Two positions that don't intersect atoms and bonds (per req. 1.4.)
So the one with the higher y coordinate is chosen (per req. 1.6.)

Image

There are 7 "longest lines" (per req. 1.3.)
There are 14 possible positions that all cross an atom or a bond (per req. 1.4.)
There are 7 equivalent solutions (AG - bond center) (per req. 1.5.)
The pictured one is chosen as it has the highest y (per req. 1.6.)

Image

There is one "longest line" (per req. 1.3.)
The position that doesn't cross an atom is chosen (per req. 1.4.)

---

$\color{ProcessBlue}{\textbf{Layout for atom-atom haptic bonds}}$

2. The bond length for haptic bonds should be 1,5 standard bond lengths.

Expand for an example

Image

---

$\color{ProcessBlue}{\textbf{Layout for haptic bonds with cyclic ligands}}$

3.1. The haptic bond should be drawn between the AG and the central atom with the length of 1,5 standard bonds.

3.2. Circular structures where at least two atoms participate in a AG (used for haptic bonds) should be contracted/squished.

3.2.1. The cycles should be "bond facing" to the central atom - meaning that two atoms from the cycle are equidistant from the central atom.

Expand for a visual example

"Atom facing" on the left, and "bond facing" on the right:

Image

3.2.2. The contracting/squishing should happen towards the line parallel to the "bond facing" bond that contains CSC.

3.2.3. The factor of contracting/squishing should be 50%.

Expand for an example

Image
Image

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named in the issue. Start by locating the existing layout handling for Markush and haptic bonds, then use the listed requirements and examples to define the behavior; done means all three layout cases satisfy the specified lengths, orientations, collision choices, and cyclic-ligand contraction.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.