From d6ee3c463f8c3aea4ce42d378f824acf1ab1cb12 Mon Sep 17 00:00:00 2001 From: Dmitrii Polovnev Date: Fri, 3 May 2024 18:24:54 +0300 Subject: [PATCH] Revert "#4508 - Bugfix (Phosphate.ts): Correct `isPartOfRna`" This reverts commit 5f06a596d246540e5678815ad5bcbc6c71a1929a. --- packages/ketcher-core/src/domain/entities/Phosphate.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/ketcher-core/src/domain/entities/Phosphate.ts b/packages/ketcher-core/src/domain/entities/Phosphate.ts index 1be072c25c..293586c026 100644 --- a/packages/ketcher-core/src/domain/entities/Phosphate.ts +++ b/packages/ketcher-core/src/domain/entities/Phosphate.ts @@ -102,14 +102,12 @@ export class Phosphate extends BaseMonomer { previousMonomer?.attachmentPointsToBonds.R3?.getAnotherMonomer( previousMonomer, ) instanceof RNABase; - if (isPreviousMonomerSugar && isSugarConnectedToBase) { - return true; - } const nextMonomer = this.attachmentPointsToBonds.R2?.getAnotherMonomer(this); + const isNextMonomerRna = !!nextMonomer?.isPartOfRna; - // The checking below used here because we need to interpret last phosphate of RNA chain + // isNextMonomerRna used here because we need to interpret last phosphate of rna chain // as not a part of nucleoTide but as phosphate connected to nucleoSide - return !!nextMonomer?.isPartOfRna; + return isPreviousMonomerSugar && isSugarConnectedToBase && isNextMonomerRna; } }