Skip to content

Commit

Permalink
#4399 - Different chains shown by the same sequence in sequence mode …
Browse files Browse the repository at this point in the history
…(system ignores sugar presence)
  • Loading branch information
baranovdv authored and rrodionov91 committed May 17, 2024
1 parent bf462b4 commit d3e5599
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,20 @@ export class NucleotideSequenceItemRenderer extends BaseSequenceItemRenderer {
.attr('cx', '10')
.attr('cy', '-16');
}

// show modification for not last Nucleoside
if (!node.phosphate) {
this.phosphateModificationCircleElement = this.rootElement
?.append('circle')
.attr('r', '3px')
.attr(
'stroke',
this.isSequenceEditInRnaBuilderModeTurnedOn ? '#24545A' : '#585858',
)
.attr('stroke-width', '1px')
.attr('fill', 'none')
.attr('cx', '10')
.attr('cy', '-16');
}
}
}
7 changes: 6 additions & 1 deletion packages/ketcher-core/src/domain/entities/Nucleoside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { RNABase } from 'domain/entities/RNABase';
import { Sugar } from 'domain/entities/Sugar';
import assert from 'assert';
import {
getNextMonomerInChain,
getRnaBaseFromSugar,
isValidNucleoside,
isValidNucleotide,
Expand Down Expand Up @@ -97,6 +98,10 @@ export class Nucleoside {
}

public get modified() {
return this.rnaBase.isModification || this.sugar.isModification;
const isNotLastNode = !!getNextMonomerInChain(this.sugar);

return (
this.rnaBase.isModification || this.sugar.isModification || isNotLastNode
);
}
}

0 comments on commit d3e5599

Please sign in to comment.