Skip to content

Commit

Permalink
#6085 - Changing of ambiguous base via RNA Builder on Sequence mode c…
Browse files Browse the repository at this point in the history
…auses sequence corruption (#6264)

* feat: add logic for natural analog base

* test:update test
  • Loading branch information
KristinaKasyanovskaya authored Jan 20, 2025
1 parent b3b6a67 commit 63019b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,17 @@ export const RnaEditorExpanded = ({
const monomerType =
monomerGroupToPresetGroup[activePresetMonomerGroup.groupName];
const field = `${monomerType}Label`;

const updatedSequenceSelection = sequenceSelection.map((node) => {
// Do not set 'phosphateLabel' for Nucleoside if it is connected and selected with Phosphate
// Do not set 'sugarLabel', 'baseLabel' for Phosphate
const naturalAnalog =
field === 'baseLabel' &&
activePresetMonomerGroup.groupItem.props?.MonomerNaturalAnalogCode
? activePresetMonomerGroup.groupItem.props
.MonomerNaturalAnalogCode
: activePresetMonomerGroup.groupItem.label;

if (
(node.isNucleosideConnectedAndSelectedWithPhosphate &&
field === 'phosphateLabel') ||
Expand All @@ -177,9 +185,10 @@ export const RnaEditorExpanded = ({

return {
...node,
[field]: activePresetMonomerGroup.groupItem.label,
[field]: naturalAnalog,
};
});

setIsSequenceSelectionUpdated(true);
dispatch(setSequenceSelection(updatedSequenceSelection));
} else {
Expand Down

0 comments on commit 63019b4

Please sign in to comment.