Skip to content

Commit

Permalink
#4530 - Convert Rx connection points created in molecules mode into c…
Browse files Browse the repository at this point in the history
…hem attachment points in macromolecules mode

- unblocked rglabels to attachment points conversion for molecules
  • Loading branch information
rrodionov91 committed May 9, 2024
1 parent eebf117 commit f2ad660
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/ketcher-core/src/domain/entities/BaseMonomer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ export abstract class BaseMonomer extends DrawingEntity {
super(_position);

this.monomerItem = { ...monomerItem };
if (!this.monomerItem.props.isMicromoleculeFragment) {
this.attachmentPointsToBonds = this.getAttachmentPointDict();
this.potentialAttachmentPointsToBonds = this.getAttachmentPointDict();
this.monomerItem.attachmentPoints =
this.monomerItem.attachmentPoints ||
this.getMonomerDefinitionAttachmentPoints();
}
this.attachmentPointsToBonds = this.getAttachmentPointDict();
this.potentialAttachmentPointsToBonds = this.getAttachmentPointDict();
this.monomerItem.attachmentPoints =
this.monomerItem.attachmentPoints ||
this.getMonomerDefinitionAttachmentPoints();
this.chosenFirstAttachmentPointForBond = null;
this.potentialSecondAttachmentPointForBond = null;
this.chosenSecondAttachmentPointForBond = null;
Expand Down Expand Up @@ -447,6 +445,12 @@ export abstract class BaseMonomer extends DrawingEntity {

this.leavingGroupsAtoms.forEach(({ rglabel }, _) => {
const label = convertAttachmentPointNumberToLabel(Number(rglabel));

// handle up to 8 attachment points
if (Number(label.replace('R', '')) > 8) {
return;
}

attachmentPointNameToBond[label] = null;
});

Expand Down

0 comments on commit f2ad660

Please sign in to comment.