Skip to content

Sequential application of “Create cyclic structure” to different segments of one chain leads to overlapping and distorted topology #3329

@Zhirnoff

Description

@Zhirnoff

Description:
When “Create cyclic structure” is applied sequentially to different fragments of the same polymer chain, the layout algorithm behaves incorrectly.
Instead of generating separate cyclic substructures within each selected fragment, system creates overlapping, cross-linked, and distorted regions.
This leads to visual and logical corruption of the chain (bonds between unrelated nodes, overlaps, broken geometry).

Steps to Reproduce

  1. Open Macromolecules → Flex mode.
  2. Open chain. ketcher (46).zip
  3. Select a small fragment of this chain.
  4. Right-click → Create cyclic structure → observe that the local cycle is created correctly.
  5. Select another segment of the same chain (not previously closed).
  6. Again choose Create cyclic structure.
  7. Observe that the new layout overlaps previous parts, bonds cross between cycles, and geometry is broken.

Actual behavior
Each new cyclic layout modifies not only the selected region but also distorts previously formed cyclic areas.
The resulting macromolecule becomes tangled, with improper bonds and overlapped monomers.
Visual representation and connectivity become inconsistent.

Expected behavior
The “Create cyclic structure” operation should only affect one continuous, non-overlapping fragment at a time.
The rest of the structure must remain unchanged.
No new cross-bonds or overlaps should appear between previously cycled and non-cycled segments.

Video

2025-11-05_11h44_16.mp4

Desktop:

  • OS: Windows 11
  • Browser Chrome
    Version 141.0.7390.108 (Official Build) (64-bit)

Ketcher version
[Version 3.10.0-rc.1]
Indigo version
[Version 1.38.0-rc.1]

This bug was found while testing: epam/ketcher#7970

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions