Skip to content

#6095-antisense-creating-work-if-ambiguous-chem-present-in-the-chain-… - #11895

Open
armankarapetyan-svg wants to merge 1 commit into
masterfrom
6095-antisense-creating-doesnt-work-if-ambiguous-chem-present-in-the-chain-selection
Open

armankarapetyan-svg wants to merge 1 commit into
masterfrom
6095-antisense-creating-doesnt-work-if-ambiguous-chem-present-in-the-chain-selection

Conversation

@armankarapetyan-svg

@armankarapetyan-svg armankarapetyan-svg commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

…selection

How the feature works? / How did you fix the issue?

(Screenshots, videos, or GIFs, if applicable)

Creating an antisense strand failed / produced wrong output when the sense chain contained an ambiguous CHEM monomer

Root cause was in DrawingEntitiesManager.createAntisenseChain:

  • The code treated any AmbiguousMonomer the same way it treats a modified phosphate, unconditionally substituting it with the non-modified phosphate library item. This caused ambiguous CHEM monomers to be replaced by P in the antisense strand instead of being mirrored as-is.
  • After restricting the phosphate substitution to ambiguous monomers whose monomerClass is actually Phosphate, the fallback path used monomer.monomerItem to recreate the ambiguous monomer on the antisense strand. That object doesn't carry the monomers array that AmbiguousMonomer requires internally, causing:
    Cannot read properties of undefined (reading 'map') in AmbiguousMonomer.getAttachmentPoints.

Fix:

  • Only substitute a non-modified phosphate when the monomer is a modified Phosphate or an ambiguous monomer whose monomerClass === KetMonomerClass.Phosphate.
  • For any other ambiguous monomer (e.g. ambiguous CHEM), reuse monomer.variantMonomerItem (the original library item, which includes the monomers array) instead of monomer.monomerItem when creating the antisense counterpart.

Result: selecting a chain with an ambiguous CHEM monomer and creating an antisense strand now mirrors the ambiguous CHEM node as-is (matching the expected screenshot), instead of erroring out or incorrectly replacing it with a phosphate.

Screen.Recording.2026-09-15.110846.mp4

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant