Skip to content

Commit

Permalink
#4508 - Bugfix (Phosphate.ts): Correct isPartOfRna
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriiP-EPAM committed Apr 25, 2024
1 parent 7296297 commit a49fc40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/ketcher-core/src/domain/entities/Phosphate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ 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;

// isNextMonomerRna used here because we need to interpret last phosphate of rna chain
// The checking below 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 isPreviousMonomerSugar && isSugarConnectedToBase && isNextMonomerRna;
return !!nextMonomer?.isPartOfRna;
}
}

0 comments on commit a49fc40

Please sign in to comment.