-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: Add antisense logic in menu dropdown * feat: Reuse antisense logic in menu dropdown from other view * feat: Update rerender for sequence mode * feat: Update Playwright tests * feat: Update Playwright test * - updated screenshots --------- Co-authored-by: Roman Rodionov <[email protected]>
- Loading branch information
1 parent
604f87f
commit 63a3386
Showing
11 changed files
with
169 additions
and
92 deletions.
There are no files selected for viewing
Binary file modified
BIN
+4.77 KB
(140%)
...-builde-568bf-ected-without-an-adjacent-nucleoside-to-left-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.61 KB
(120%)
...-entire-chain-and-see-enabled-modify-in-rna-builder-button-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.33 KB
(130%)
...-nucle-fafd5-dify-sugar-and-phosphate-as-it-one-nucleotide-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.22 KB
(130%)
...t-nucle-fc129-hosphate-nucleoside-should-become-nucleotide-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.31 KB
(130%)
...edit-in-RNA-Builder-Select-one-nucleotide-and-modify-sugar-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.03 KB
(130%)
...lder-Select-two-nucleotides-and-modify-sugar-and-phosphate-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
.../ketcher-macromolecules/src/components/contextMenu/SelectedMonomersContextMenu/helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import { | ||
AmbiguousMonomer, | ||
BaseMonomer, | ||
getRnaBaseFromSugar, | ||
isRnaBaseOrAmbiguousRnaBase, | ||
KetAmbiguousMonomerTemplateSubType, | ||
RNABase, | ||
Sugar, | ||
} from 'ketcher-core'; | ||
|
||
const getMonomersCode = (monomers: BaseMonomer[]) => { | ||
return monomers | ||
.map((monomer) => monomer.monomerItem.props.MonomerNaturalAnalogCode) | ||
.sort() | ||
.join(''); | ||
}; | ||
|
||
export const isSenseBase = (monomer: BaseMonomer | AmbiguousMonomer) => { | ||
const { monomerItem } = monomer; | ||
const isNaturalAnalogue = | ||
monomerItem.props.MonomerNaturalAnalogCode === 'A' || | ||
monomerItem.props.MonomerNaturalAnalogCode === 'C' || | ||
monomerItem.props.MonomerNaturalAnalogCode === 'G' || | ||
monomerItem.props.MonomerNaturalAnalogCode === 'T' || | ||
monomerItem.props.MonomerNaturalAnalogCode === 'U'; | ||
if (isNaturalAnalogue) { | ||
return true; | ||
} | ||
if (!monomer.monomerItem.isAmbiguous) { | ||
return false; | ||
} | ||
|
||
if ( | ||
(monomer as AmbiguousMonomer).subtype === | ||
KetAmbiguousMonomerTemplateSubType.MIXTURE | ||
) { | ||
return false; | ||
} | ||
|
||
const N1 = 'ACGT'; | ||
const N2 = 'ACGU'; | ||
const B1 = 'CGT'; | ||
const B2 = 'CGU'; | ||
const D1 = 'AGT'; | ||
const D2 = 'AGU'; | ||
const H1 = 'ACT'; | ||
const H2 = 'ACU'; | ||
const K1 = 'GT'; | ||
const K2 = 'GU'; | ||
const W1 = 'AT'; | ||
const W2 = 'AU'; | ||
const Y1 = 'CT'; | ||
const Y2 = 'CU'; | ||
const M = 'AC'; | ||
const R = 'AG'; | ||
const S = 'CG'; | ||
const V = 'ACG'; | ||
const ambigues = [ | ||
N1, | ||
N2, | ||
B1, | ||
B2, | ||
D1, | ||
D2, | ||
H1, | ||
H2, | ||
K1, | ||
K2, | ||
W1, | ||
W2, | ||
Y1, | ||
Y2, | ||
M, | ||
R, | ||
S, | ||
V, | ||
]; | ||
const code = getMonomersCode((monomer as AmbiguousMonomer).monomers); | ||
return ambigues.some((v) => v === code); | ||
}; | ||
|
||
export const isAntisenseCreationDisabled = ( | ||
selectedMonomers: BaseMonomer[], | ||
) => { | ||
return selectedMonomers?.some((selectedMonomer: BaseMonomer) => { | ||
const rnaBaseForSugar = | ||
selectedMonomer instanceof Sugar && getRnaBaseFromSugar(selectedMonomer); | ||
|
||
return ( | ||
(selectedMonomer instanceof RNABase && | ||
(selectedMonomer.hydrogenBonds.length > 0 || | ||
selectedMonomer.covalentBonds.length > 1)) || | ||
(isRnaBaseOrAmbiguousRnaBase(selectedMonomer) && | ||
!isSenseBase(selectedMonomer)) || | ||
(rnaBaseForSugar && | ||
(rnaBaseForSugar.hydrogenBonds.length > 0 || | ||
!isSenseBase(rnaBaseForSugar))) | ||
); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters