Skip to content

Commit

Permalink
Merge branch 'master' into 6149-library-ambiguius-rna-bases-loaded-fr…
Browse files Browse the repository at this point in the history
…om-helm-as-bases-with-label
  • Loading branch information
KristinaKasyanovskaya committed Feb 5, 2025
2 parents 692bb58 + caf34d8 commit 16e84ea
Show file tree
Hide file tree
Showing 495 changed files with 3,086 additions and 1,916 deletions.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -26,7 +26,6 @@ import { drawReactionWithTwoBenzeneRings } from '@utils/canvas/drawStructures';
import {
clickOnFileFormatDropdown,
getMolfile,
getRxn,
getSdf,
getSmiles,
} from '@utils/formats';
Expand Down Expand Up @@ -63,24 +62,12 @@ test.describe('Save files', () => {
ARROW_LENGTH,
);

const expectedFile = await getRxn(page, 'v2000');
await saveToFile(
await verifyFileExport(
page,
'Rxn-V2000/rxn-1849-to-compare-expectedV2000.rxn',
expectedFile,
FileType.RXN,
'v2000',
);

const METADATA_STRING_INDEX = [2, 7, 25];

const { fileExpected: rxnFileExpected, file: rxnFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Rxn-V2000/rxn-1849-to-compare-expectedV2000.rxn',
metaDataIndexes: METADATA_STRING_INDEX,
fileFormat: 'v2000',
});

expect(rxnFile).toEqual(rxnFileExpected);
});

test('Save file - Save *.mol file', async ({ page }) => {
Expand Down Expand Up @@ -143,21 +130,12 @@ test.describe('Save files', () => {
Description: Structure reaction consists of two or more reaction arrows saved as .rxn file
*/
await openFileAndAddToCanvas('KET/two-arrows-and-plus.ket', page);
const expectedFile = await getRxn(page);
await saveToFile(
await verifyFileExport(
page,
'Rxn-V2000/two-arrows-and-plus-expected.rxn',
expectedFile,
FileType.RXN,
'v2000',
);

const METADATA_STRING_INDEX = [2, 7, 25, 32, 54];
const { fileExpected: rxnFileExpected, file: rxnFile } =
await receiveFileComparisonData({
page,
metaDataIndexes: METADATA_STRING_INDEX,
expectedFileName:
'tests/test-data/Rxn-V2000/two-arrows-and-plus-expected.rxn',
});
expect(rxnFile).toEqual(rxnFileExpected);
});

test('Automatic selection of MDL Molfile v3000 encoding is work if the number of atoms (or bonds) exceeds 999', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
FileType,
verifyFileExport,
} from '@utils/files/receiveFileComparisonData';
import { getRxn, getSmiles } from '@utils/formats';
import { getSmiles } from '@utils/formats';
import {
pressRedoButton,
pressUndoButton,
Expand Down Expand Up @@ -272,61 +272,36 @@ test.describe('Aromatize/Dearomatize Tool', () => {
'Rxn-V2000/aromatic-benzene-rxnv2000.rxn',
page,
);
const expectedFile = await getRxn(page, 'v2000');
await saveToFile(
await verifyFileExport(
page,
'Rxn-V2000/aromatic-benzene-rxnv2000-expected.rxn',
expectedFile,
FileType.RXN,
'v2000',
);

const METADATA_STRING_INDEX = [2, 7, 64];

const { fileExpected: rxnFileExpected, file: rxnFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Rxn-V2000/aromatic-benzene-rxnv2000-expected.rxn',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(rxnFile).toEqual(rxnFileExpected);
await takeEditorScreenshot(page);
});

test.fail(
'(RxnV3000) Save cyclic structures with a circle inside the cycle',
async ({ page }) => {
/*
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2476
test('(RxnV3000) Save cyclic structures with a circle inside the cycle', async ({
page,
}) => {
/*
Test case: EPMLSOPKET-1877
Description: The structures are saved as rxn-file.
The saved rxn-file is opened correctly. In Ketcher the saved structures appear
with the circle inside the cycles.
*/
await openFileAndAddToCanvas(
'Molfiles-V3000/aromatic-benzene-rxnv3000.rxn',
page,
);
const expectedFile = await getRxn(page, 'v3000');
await saveToFile(
'Molfiles-V3000/aromatic-benzene-rxnv3000-expected.rxn',
expectedFile,
);

const METADATA_STRING_INDEX = [2];

const { fileExpected: rxnFileExpected, file: rxnFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/aromatic-benzene-rxnv3000-expected.rxn',
metaDataIndexes: METADATA_STRING_INDEX,
fileFormat: 'v3000',
});

expect(rxnFile).toEqual(rxnFileExpected);
await takeEditorScreenshot(page);
},
);
await openFileAndAddToCanvas(
'Molfiles-V3000/aromatic-benzene-rxnv3000.rxn',
page,
);
await verifyFileExport(
page,
'Rxn-V3000/aromatic-benzene-rxnv3000-expected.rxn',
FileType.RXN,
'v3000',
);
await takeEditorScreenshot(page);
});

test('(Cml file) Save cyclic structures with a circle inside the cycle', async ({
page,
Expand Down
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 @@ -288,81 +288,72 @@ const shortMonomerList: IMonomer[] = [

for (const leftMonomer of shortMonomerList) {
for (const rightMonomer of shortMonomerList) {
test(
`1-${leftMonomer.id}-${rightMonomer.id}. Hydrogen side chain for: ${leftMonomer.monomerDescription} and ${rightMonomer.monomerDescription}`,
{ tag: ['@IncorrectResultBecauseOfBug'] },
async () => {
/*
* Test task: https://github.com/epam/ketcher/issues/6184
* Description: Check if hydrogen bonds connect monomers inside one chain, those
* hydrogen bonds should be considered as side chain connections for layout purposes
* Case:
* 1. Load two monomers on the canvas
* 2. Connect them with hydrogen bond
* 3. Switch to the flex/snake mode to refresh layout
* 4. Take screenshot to validate layout (connection should be considered as side chain)
*
* WARNING: Some test tesults are wrong because of bugs:
* https://github.com/epam/ketcher/issues/6194
* https://github.com/epam/ketcher/issues/6195
* Screenshots must be updated after fix and fixme should be removed
*/
test.setTimeout(30000);
test(`1-${leftMonomer.id}-${rightMonomer.id}. Hydrogen side chain for: ${leftMonomer.monomerDescription} and ${rightMonomer.monomerDescription}`, async () => {
/*
* Test task: https://github.com/epam/ketcher/issues/6184
* Description: Check if hydrogen bonds connect monomers inside one chain, those
* hydrogen bonds should be considered as side chain connections for layout purposes
* Case:
* 1. Load two monomers on the canvas
* 2. Connect them with hydrogen bond
* 3. Switch to the flex/snake mode to refresh layout
* 4. Take screenshot to validate layout (connection should be considered as side chain)
*/
test.setTimeout(30000);

await loadMonomerOnCanvas(page, leftMonomer);
let leftMonomerAlias;
if (leftMonomer.type === 'Nucleoside') {
leftMonomerAlias = 'R';
} else if (leftMonomer.type === 'Nucleotide') {
leftMonomerAlias = 'P';
} else {
leftMonomerAlias = leftMonomer.alias;
}
const leftMonomerLocator = (
await loadMonomerOnCanvas(page, leftMonomer);
let leftMonomerAlias;
if (leftMonomer.type === 'Nucleoside') {
leftMonomerAlias = 'R';
} else if (leftMonomer.type === 'Nucleotide') {
leftMonomerAlias = 'P';
} else {
leftMonomerAlias = leftMonomer.alias;
}
const leftMonomerLocator = (
await getMonomerLocator(page, {
monomerAlias: leftMonomerAlias,
})
).first();
await loadMonomerOnCanvas(page, rightMonomer);
let rightMonomerAlias;
if (rightMonomer.type === 'Nucleoside') {
rightMonomerAlias = 'R';
} else if (rightMonomer.type === 'Nucleotide') {
rightMonomerAlias = 'P';
} else {
rightMonomerAlias = rightMonomer.alias;
}
const rightMonomerLocator =
(await (
await getMonomerLocator(page, {
monomerAlias: leftMonomerAlias,
monomerAlias: rightMonomerAlias,
})
).first();
await loadMonomerOnCanvas(page, rightMonomer);
let rightMonomerAlias;
if (rightMonomer.type === 'Nucleoside') {
rightMonomerAlias = 'R';
} else if (rightMonomer.type === 'Nucleotide') {
rightMonomerAlias = 'P';
} else {
rightMonomerAlias = rightMonomer.alias;
}
const rightMonomerLocator =
(await (
await getMonomerLocator(page, {
monomerAlias: rightMonomerAlias,
})
).count()) > 1
? (
await getMonomerLocator(page, {
monomerAlias: rightMonomerAlias,
})
).nth(1)
: (
await getMonomerLocator(page, {
monomerAlias: rightMonomerAlias,
})
).first();
).count()) > 1
? (
await getMonomerLocator(page, {
monomerAlias: rightMonomerAlias,
})
).nth(1)
: (
await getMonomerLocator(page, {
monomerAlias: rightMonomerAlias,
})
).first();

await bondTwoMonomers(
page,
leftMonomerLocator,
rightMonomerLocator,
undefined,
undefined,
MacroBondTool.HYDROGEN,
);
await bondTwoMonomers(
page,
leftMonomerLocator,
rightMonomerLocator,
undefined,
undefined,
MacroBondTool.HYDROGEN,
);

await selectFlexLayoutModeTool(page);
await selectSnakeLayoutModeTool(page);
await takeEditorScreenshot(page, { hideMonomerPreview: true });
},
);
await selectFlexLayoutModeTool(page);
await selectSnakeLayoutModeTool(page);
await takeEditorScreenshot(page, { hideMonomerPreview: true });
});
}
}

Expand Down Expand Up @@ -776,38 +767,31 @@ test(`8. Check that multiple backbones/chains can be placed in on a line if they
await takeEditorScreenshot(page, { hideMonomerPreview: true });
});

test(
`9. Check if there is a circular hydrogen bond connection between three or more chains,
those hydrogen bonds should be considered as side chain connection for layout purposes`,
{ tag: ['@IncorrectResultBecauseOfBug'] },
async () => {
/*
* Test task: https://github.com/epam/ketcher/issues/6184
* Description: Check if there is a circular hydrogen bond connection between three or more chains,
* those hydrogen bonds should be considered as side chain connection for layout purposes
* Case:
* 1. Load very long chain with short antisense connected on the canvas
* 2. Take screenshot to validate layout
*
* WARNING: Some test tesults are wrong because of bugs:
* https://github.com/epam/ketcher/issues/6201
*/
test.setTimeout(20000);
test(`9. Check if there is a circular hydrogen bond connection between three or more chains,
those hydrogen bonds should be considered as side chain connection for layout purposes`, async () => {
/*
* Test task: https://github.com/epam/ketcher/issues/6184
* Description: Check if there is a circular hydrogen bond connection between three or more chains,
* those hydrogen bonds should be considered as side chain connection for layout purposes
* Case:
* 1. Load very long chain with short antisense connected on the canvas
* 2. Take screenshot to validate layout
*/
test.setTimeout(20000);

await pasteFromClipboardAndAddToMacromoleculesCanvas(
page,
MacroFileType.HELM,
'RNA1{R(C)P.R(A)P.R(A)P}|' +
'RNA2{R(G)P.R(T)P.R(U)P}|' +
'RNA3{R(C)P.R(A)P.R(A)P}$' +
'RNA1,RNA2,8:pair-8:pair|' +
'RNA2,RNA3,2:pair-2:pair|' +
'RNA3,RNA1,8:pair-2:pair$$$V2.0',
);
await pasteFromClipboardAndAddToMacromoleculesCanvas(
page,
MacroFileType.HELM,
'RNA1{R(C)P.R(A)P.R(A)P}|' +
'RNA2{R(G)P.R(T)P.R(U)P}|' +
'RNA3{R(C)P.R(A)P.R(A)P}$' +
'RNA1,RNA2,8:pair-8:pair|' +
'RNA2,RNA3,2:pair-2:pair|' +
'RNA3,RNA1,8:pair-2:pair$$$V2.0',
);

await takeEditorScreenshot(page, { hideMonomerPreview: true });
},
);
await takeEditorScreenshot(page, { hideMonomerPreview: true });
});

for (const leftMonomer of eligibleForAntisenseMonomerList) {
for (const rightMonomer of eligibleForAntisenseMonomerList) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 16e84ea

Please sign in to comment.