epam / ketcher

Web-based molecule sketcher
https://lifescience.opensource.epam.com/ketcher/demo.html
Apache License 2.0
441 stars 158 forks source link

Preset with sugar without R3 AP can be created, when choosing base directly from the "Bases" section #4896

Open ViktoriaTkacheva opened 1 week ago

ViktoriaTkacheva commented 1 week ago

Steps to Reproduce

  1. Switch to the Macro mode – the Fullscreen mode
  2. In the RNA tab create a new preset, choosing the sugar 12ddR

    image
  3. Click on the “Bases” section and choose any base
  4. Choose any phosphate and click on the “Add to Presets” button
  5. Add this preset on the canvas

Actual behavior It is not possible to add the preset to the canvas, when the sugar does not contain R3 attachment point. There is an error in the Console: Uncaught ReferenceError: process is not defined

image

rc.test.lifescience.opensource.epam.com-1719410532074.log

Expected behavior If sugar added to RNA builder doesn't have R2 or R3 AP, OR phosphate doesn't have R1 AP, OR base doesn't have R1 AP, then the Error message should appear and preset should not be saved. Error message: • Selected sugar doesn't have the attachment point to establish bond with the base. (Sugar lacks R3) • Selected sugar doesn't have the attachment point to establish bond with the phosphate. (Sugar lacks R2) • Selected base doesn't have the attachment point to establish bond with the sugar. (Base lacks R1) • Selected phosphate doesn't have the attachment point to establish bond with the sugar. (Phosphate lacks R1) If defected preset already exists in library, then it could be added to canvas as a group of monomers, but the bonds should be established only between existing AP.

Screenshots

https://github.com/epam/ketcher/assets/139227567/d5f5cc50-eb17-41db-9495-444f3bac27a9

Desktop (please complete the following information):

Ketcher version 2.22.0-rc.7, Build at 2024-06-20; 18:48:41

Issue found while testing https://github.com/epam/ketcher/issues/3615