@datagrok/sequence-translator 1.0.17 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +4 -3
- package/CHANGELOG.md +36 -0
- package/detectors.js +8 -0
- package/dist/package-test.js +2 -73079
- package/dist/package-test.js.map +1 -0
- package/dist/package.js +2 -72284
- package/dist/package.js.map +1 -0
- package/files/axolabs-style.json +97 -0
- package/files/codes-to-symbols.json +67 -0
- package/files/formats-to-helm.json +63 -0
- package/files/linkers.json +22 -0
- package/files/monomer-lib.json +1142 -0
- package/link-bio +7 -0
- package/package.json +30 -31
- package/scripts/build-monomer-lib.py +391 -122
- package/src/demo/demo-st-ui.ts +71 -0
- package/src/demo/handle-error.ts +12 -0
- package/src/model/axolabs/axolabs-tab.ts +111 -0
- package/src/model/axolabs/const.ts +33 -0
- package/src/{axolabs-tab → model/axolabs}/draw-svg.ts +1 -1
- package/src/{axolabs-tab → model/axolabs}/helpers.ts +7 -5
- package/src/model/const.ts +18 -0
- package/src/model/data-loading-utils/const.ts +8 -0
- package/src/model/data-loading-utils/json-loader.ts +38 -0
- package/src/model/data-loading-utils/types.ts +30 -0
- package/src/model/format-translation/const.ts +8 -0
- package/src/model/format-translation/conversion-utils.ts +49 -0
- package/src/model/format-translation/format-converter.ts +109 -0
- package/src/model/helpers.ts +12 -0
- package/src/model/monomer-lib/const.ts +3 -0
- package/src/model/monomer-lib/lib-wrapper.ts +119 -0
- package/src/model/parsing-validation/format-detector.ts +57 -0
- package/src/model/parsing-validation/sequence-validator.ts +52 -0
- package/src/model/sequence-to-structure-utils/const.ts +1 -0
- package/src/{utils/structures-works → model/sequence-to-structure-utils}/mol-transformations.ts +33 -41
- package/src/model/sequence-to-structure-utils/monomer-code-parser.ts +92 -0
- package/src/model/sequence-to-structure-utils/sdf-tab.ts +97 -0
- package/src/model/sequence-to-structure-utils/sequence-to-molfile.ts +409 -0
- package/src/package-test.ts +3 -1
- package/src/package.ts +113 -91
- package/src/tests/const.ts +24 -0
- package/src/tests/formats-support.ts +40 -0
- package/src/tests/formats-to-helm.ts +53 -0
- package/src/tests/helm-to-nucleotides.ts +28 -0
- package/src/view/const/main-tab.ts +3 -0
- package/src/view/const/view.ts +10 -0
- package/src/view/css/axolabs-tab.css +1 -0
- package/src/view/css/colored-text-input.css +27 -0
- package/src/view/css/main-tab.css +46 -0
- package/src/view/css/sdf-tab.css +39 -0
- package/src/view/monomer-lib-viewer/viewer.ts +22 -0
- package/src/view/tabs/axolabs.ts +719 -0
- package/src/view/tabs/main.ts +174 -0
- package/src/view/tabs/sdf.ts +193 -0
- package/src/view/utils/app-info-dialog.ts +18 -0
- package/src/view/utils/colored-input/colored-text-input.ts +56 -0
- package/src/view/utils/colored-input/input-painters.ts +44 -0
- package/src/view/utils/draw-molecule.ts +86 -0
- package/src/view/utils/molecule-img.ts +106 -0
- package/src/view/view.ts +127 -0
- package/tsconfig.json +12 -18
- package/webpack.config.js +17 -4
- package/README.md +0 -84
- package/css/style.css +0 -18
- package/img/Sequence Translator Axolabs.png +0 -0
- package/jest.config.js +0 -33
- package/setup-unlink-clean.cmd +0 -14
- package/setup-unlink-clean.sh +0 -21
- package/setup.cmd +0 -14
- package/setup.sh +0 -37
- package/src/__jest__/remote.test.ts +0 -77
- package/src/__jest__/test-node.ts +0 -97
- package/src/apps/oligo-sd-file-app.ts +0 -58
- package/src/autostart/calculations.ts +0 -40
- package/src/autostart/constants.ts +0 -37
- package/src/autostart/registration.ts +0 -306
- package/src/axolabs-tab/axolabs-tab.ts +0 -873
- package/src/axolabs-tab/define-pattern.ts +0 -874
- package/src/hardcode-to-be-eliminated/ICDs.ts +0 -3
- package/src/hardcode-to-be-eliminated/IDPs.ts +0 -3
- package/src/hardcode-to-be-eliminated/const.ts +0 -5
- package/src/hardcode-to-be-eliminated/constants.ts +0 -101
- package/src/hardcode-to-be-eliminated/converters.ts +0 -323
- package/src/hardcode-to-be-eliminated/map.ts +0 -720
- package/src/hardcode-to-be-eliminated/salts.ts +0 -2
- package/src/hardcode-to-be-eliminated/sources.ts +0 -3
- package/src/hardcode-to-be-eliminated/users.ts +0 -3
- package/src/main-tab/main-tab.ts +0 -210
- package/src/sdf-tab/sdf-tab.ts +0 -163
- package/src/sdf-tab/sequence-codes-tools.ts +0 -347
- package/src/tests/smiles-tests.ts +0 -458
- package/src/utils/const.ts +0 -0
- package/src/utils/helpers.ts +0 -28
- package/src/utils/parse.ts +0 -27
- package/src/utils/sdf-add-columns.ts +0 -118
- package/src/utils/sdf-save-table.ts +0 -56
- package/src/utils/structures-works/draw-molecule.ts +0 -84
- package/src/utils/structures-works/from-monomers.ts +0 -266
- package/test-SequenceTranslator-6288c2fbe346-695b7b55.html +0 -259
- package/vendors/openchemlib-full.js +0 -293
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as DG from 'datagrok-api/dg';
|
|
2
|
-
import {COL_NAMES, GENERATED_COL_NAMES, SEQUENCE_TYPES} from '../autostart/constants';
|
|
3
|
-
import {differenceOfTwoArrays, download} from '../utils/helpers';
|
|
4
|
-
import * as grok from 'datagrok-api/grok';
|
|
5
|
-
import {SYNTHESIZERS} from '../hardcode-to-be-eliminated/map';
|
|
6
|
-
import {sequenceToMolV3000} from '../utils/structures-works/from-monomers';
|
|
7
|
-
import {parseStrandsFromDuplexCell, parseStrandsFromTriplexOrDimerCell} from './parse';
|
|
8
|
-
import {linkStrandsV3000} from '../utils/structures-works/mol-transformations';
|
|
9
|
-
|
|
10
|
-
export async function sdfSaveTable(table: DG.DataFrame, onError: (rowI: number, err: any) => void) {
|
|
11
|
-
if (GENERATED_COL_NAMES.some((colName) => !table.columns.contains(colName))) {
|
|
12
|
-
const absentColNames = differenceOfTwoArrays(GENERATED_COL_NAMES, table.columns.names()).join(`', '`);
|
|
13
|
-
grok.shell.warning(`File saved without columns '${absentColNames}'`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const sequenceCol = table.getCol(COL_NAMES.SEQUENCE);
|
|
17
|
-
const typeCol = table.getCol(COL_NAMES.TYPE);
|
|
18
|
-
|
|
19
|
-
let resultStr = '';
|
|
20
|
-
const rowCount = table.rowCount;
|
|
21
|
-
for (let i = 0; i < rowCount; i++) {
|
|
22
|
-
try {
|
|
23
|
-
let rowStr = '';
|
|
24
|
-
const format = SYNTHESIZERS.GCRS; //getFormat(sequenceCol.get(i))!;
|
|
25
|
-
if (typeCol.get(i) == SEQUENCE_TYPES.SENSE_STRAND) {
|
|
26
|
-
rowStr += `${sequenceToMolV3000(sequenceCol.get(i), false, true, format)}\n> <Sequence>\nSense Strand\n\n`;
|
|
27
|
-
} else if (typeCol.get(i) == SEQUENCE_TYPES.ANTISENSE_STRAND) {
|
|
28
|
-
rowStr += `${sequenceToMolV3000(sequenceCol.get(i), true, true, format)}\n> <Sequence>\nAnti Sense\n\n`;
|
|
29
|
-
} else if (typeCol.get(i) == SEQUENCE_TYPES.DUPLEX) {
|
|
30
|
-
const obj = parseStrandsFromDuplexCell(sequenceCol.get(i));
|
|
31
|
-
const as = `${sequenceToMolV3000(obj.AS, true, true, format)}\n> <Sequence>\nAnti Sense\n\n`;
|
|
32
|
-
const ss = `${sequenceToMolV3000(obj.SS, false, true, format)}\n> <Sequence>\nSense Strand\n\n`;
|
|
33
|
-
rowStr += `${linkStrandsV3000({senseStrands: [ss], antiStrands: [as]}, true)}\n\n`;
|
|
34
|
-
} else if ([SEQUENCE_TYPES.TRIPLEX, SEQUENCE_TYPES.DIMER].includes(typeCol.get(i))) {
|
|
35
|
-
const obj = parseStrandsFromTriplexOrDimerCell(sequenceCol.get(i));
|
|
36
|
-
const as1 = `${sequenceToMolV3000(obj.AS1, true, true, format)}\n> <Sequence>\nAnti Sense\n\n`;
|
|
37
|
-
const as2 = `${sequenceToMolV3000(obj.AS2, true, true, format)}\n> <Sequence>\nAnti Sense\n\n`;
|
|
38
|
-
const ss = `${sequenceToMolV3000(obj.SS, false, true, format)}\n> <Sequence>\nSense Strand\n\n`;
|
|
39
|
-
rowStr += `${linkStrandsV3000({senseStrands: [ss], antiStrands: [as1, as2]}, true)}\n\n`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
for (const col of table.columns) {
|
|
43
|
-
if (col.name != COL_NAMES.SEQUENCE)
|
|
44
|
-
rowStr += `> <${col.name}>\n${col.get(i)}\n\n`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
rowStr += '$$$$\n';
|
|
48
|
-
|
|
49
|
-
resultStr += rowStr;
|
|
50
|
-
} catch (err: any) {
|
|
51
|
-
onError(i, err);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
download(`${table.name}.sdf`, encodeURIComponent(resultStr));
|
|
56
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/* Do not change these import lines to match external modules in webpack configuration */
|
|
2
|
-
import * as grok from 'datagrok-api/grok';
|
|
3
|
-
import * as ui from 'datagrok-api/ui';
|
|
4
|
-
import * as DG from 'datagrok-api/dg';
|
|
5
|
-
import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
|
|
6
|
-
|
|
7
|
-
import $ from 'cash-dom';
|
|
8
|
-
|
|
9
|
-
import {extractAtomDataV3000} from './mol-transformations';
|
|
10
|
-
|
|
11
|
-
/** Draw molecule on the canvas and append it to the specified div, with the
|
|
12
|
-
* option of zoom-in */
|
|
13
|
-
export async function drawMolecule(
|
|
14
|
-
moleculeImgDiv: HTMLDivElement,
|
|
15
|
-
canvasWidth: number, canvasHeight: number,
|
|
16
|
-
molfile: string
|
|
17
|
-
): Promise<void> {
|
|
18
|
-
// clear the div's content if any
|
|
19
|
-
async function drawMolfileOnCanvas(canvas: HTMLCanvasElement): Promise<void> {
|
|
20
|
-
await grok.functions.call('Chem:canvasMol', {
|
|
21
|
-
x: 0, y: 0, w: canvas.width, h: canvas.height, canvas: canvas,
|
|
22
|
-
molString: molfile, scaffoldMolString: '',
|
|
23
|
-
options: {normalizeDepiction: false, straightenDepiction: false}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
async function drawZoomedInMolecule(): Promise<void> {
|
|
28
|
-
try {
|
|
29
|
-
const dialogDivStyle = {
|
|
30
|
-
overflowX: 'scroll',
|
|
31
|
-
};
|
|
32
|
-
const dialogDiv = ui.div([], {style: dialogDivStyle});
|
|
33
|
-
|
|
34
|
-
// dialogDiv size required, but now available before dialog show()
|
|
35
|
-
const atomCoordinates = extractAtomDataV3000(molfile);
|
|
36
|
-
// const cw: number = $(window).width() * 0.80; // dialogDiv.clientWidth
|
|
37
|
-
const clientHeight: number = $(window).height() * 0.70; // dialogDiv.clientHeight
|
|
38
|
-
const molWidth: number = Math.max(...atomCoordinates.x) - Math.min(...atomCoordinates.x);
|
|
39
|
-
const molHeight: number = Math.max(...atomCoordinates.y) - Math.min(...atomCoordinates.y);
|
|
40
|
-
|
|
41
|
-
// const wR: number = cw / molWidth;
|
|
42
|
-
const hR: number = clientHeight / molHeight;
|
|
43
|
-
const r: number = hR; // Math.max(wR, hR);
|
|
44
|
-
const dialogCanvasWidth = r * molWidth;
|
|
45
|
-
const dialogCanvasHeight = r * molHeight;
|
|
46
|
-
|
|
47
|
-
const dialogCanvas = ui.canvas(
|
|
48
|
-
dialogCanvasWidth * window.devicePixelRatio, dialogCanvasHeight * window.devicePixelRatio
|
|
49
|
-
);
|
|
50
|
-
dialogCanvas.style.width = `${dialogCanvasWidth}px`;
|
|
51
|
-
dialogCanvas.style.height = `${dialogCanvasHeight}px`;
|
|
52
|
-
await drawMolfileOnCanvas(dialogCanvas);
|
|
53
|
-
|
|
54
|
-
dialogDiv.appendChild(dialogCanvas);
|
|
55
|
-
ui.dialog('Molecule')
|
|
56
|
-
.add(dialogDiv)
|
|
57
|
-
.showModal(true);
|
|
58
|
-
} catch (err) {
|
|
59
|
-
const errStr = errorToConsole(err);
|
|
60
|
-
console.error(errStr);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// clear div's content if any
|
|
65
|
-
moleculeImgDiv.innerHTML = '';
|
|
66
|
-
|
|
67
|
-
if (molfile !== '') {
|
|
68
|
-
const canvas = ui.canvas(canvasWidth * window.devicePixelRatio, canvasHeight * window.devicePixelRatio);
|
|
69
|
-
|
|
70
|
-
// Draw zoomed-out molecule
|
|
71
|
-
canvas.style.width = `${canvasWidth}px`;
|
|
72
|
-
canvas.style.height = `${canvasHeight}px`;
|
|
73
|
-
canvas.style.borderStyle = 'solid';
|
|
74
|
-
canvas.style.borderColor = 'blue';
|
|
75
|
-
drawMolfileOnCanvas(canvas);
|
|
76
|
-
|
|
77
|
-
// Dialog with zoomed-in molecule
|
|
78
|
-
$(canvas).on('click', drawZoomedInMolecule);
|
|
79
|
-
$(canvas).on('mouseover', () => $(canvas).css('cursor', 'grab')); // for some reason 'zoom-in' value wouldn't work
|
|
80
|
-
$(canvas).on('mouseout', () => $(canvas).css('cursor', 'default'));
|
|
81
|
-
|
|
82
|
-
moleculeImgDiv.append(canvas);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
// import {map, SYNTHESIZERS, TECHNOLOGIES, MODIFICATIONS, DELIMITER} from './map';
|
|
2
|
-
import {map, SYNTHESIZERS, TECHNOLOGIES, DELIMITER} from '../../hardcode-to-be-eliminated/map';
|
|
3
|
-
import {isValidSequence} from '../../sdf-tab/sequence-codes-tools';
|
|
4
|
-
import {sortByStringLengthInDescendingOrder} from '../helpers';
|
|
5
|
-
import {getMonomerWorks} from '../../package';
|
|
6
|
-
import {getNucleotidesMol} from './mol-transformations';
|
|
7
|
-
|
|
8
|
-
import {standardPhosphateLinkSmiles, MODIFICATIONS} from '../../hardcode-to-be-eliminated/const';
|
|
9
|
-
import {getMonomerLib} from '../../package';
|
|
10
|
-
// todo: remove
|
|
11
|
-
// const NAME = 'name';
|
|
12
|
-
const CODES = 'codes';
|
|
13
|
-
// const SMILES = 'smiles';
|
|
14
|
-
const MOL = 'molfile';
|
|
15
|
-
|
|
16
|
-
export function sequenceToMolV3000(
|
|
17
|
-
sequence: string, inverted: boolean = false, oclRender: boolean = false,
|
|
18
|
-
format: string
|
|
19
|
-
): string {
|
|
20
|
-
const monomerNameFromCode = getCodeToNameMap(sequence, format);
|
|
21
|
-
let codes = sortByStringLengthInDescendingOrder(Object.keys(monomerNameFromCode));
|
|
22
|
-
let i = 0;
|
|
23
|
-
const codesList = [];
|
|
24
|
-
const links = ['s', 'ps', '*'];
|
|
25
|
-
const includesStandardLinkAlready = ['e', 'h', /*'g',*/ 'f', 'i', 'l', 'k', 'j'];
|
|
26
|
-
const dropdowns = Object.keys(MODIFICATIONS);
|
|
27
|
-
codes = codes.concat(dropdowns).concat(DELIMITER);
|
|
28
|
-
while (i < sequence.length) {
|
|
29
|
-
const code = codes.find((s: string) => s === sequence.slice(i, i + s.length))!;
|
|
30
|
-
i += code.length;
|
|
31
|
-
inverted ? codesList.unshift(code) : codesList.push(code);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const monomers: string[] = [];
|
|
35
|
-
|
|
36
|
-
for (let i = 0; i < codesList.length; i++) {
|
|
37
|
-
if (links.includes(codesList[i]) ||
|
|
38
|
-
includesStandardLinkAlready.includes(codesList[i]) ||
|
|
39
|
-
(i < codesList.length - 1 && links.includes(codesList[i + 1]))
|
|
40
|
-
) {
|
|
41
|
-
const aa = monomerNameFromCode[codesList[i]];
|
|
42
|
-
if (aa !== undefined)
|
|
43
|
-
monomers.push(aa);
|
|
44
|
-
else
|
|
45
|
-
monomers.push(codesList[i]);
|
|
46
|
-
} else {
|
|
47
|
-
const aa = monomerNameFromCode[codesList[i]];
|
|
48
|
-
if (aa !== undefined)
|
|
49
|
-
monomers.push(aa);
|
|
50
|
-
else
|
|
51
|
-
monomers.push(codesList[i]);
|
|
52
|
-
monomers.push('p linkage');
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const lib = getMonomerLib();
|
|
57
|
-
const mols: string [] = [];
|
|
58
|
-
for (let i = 0; i < monomers.length; i++) {
|
|
59
|
-
const mnmr = lib?.getMonomer('RNA', monomers[i]);
|
|
60
|
-
mols.push(mnmr?.molfile!);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return getNucleotidesMol(mols);
|
|
65
|
-
//return getMonomerWorks()?.getAtomicLevel(monomers, 'RNA')!;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function sequenceToMolV3000_new(
|
|
69
|
-
sequence: string, inverted: boolean = false, oclRender: boolean = false,
|
|
70
|
-
format: string,
|
|
71
|
-
): string {
|
|
72
|
-
const monomerNameFromCode = getCodeToNameMap(sequence, format);
|
|
73
|
-
let codes = sortByStringLengthInDescendingOrder(Object.keys(monomerNameFromCode));
|
|
74
|
-
let i = 0;
|
|
75
|
-
const codesList = [];
|
|
76
|
-
const links = ['s', 'ps', '*'];
|
|
77
|
-
const includesStandardLinkAlready = ['e', 'h', /*'g',*/ 'f', 'i', 'l', 'k', 'j'];
|
|
78
|
-
const dropdowns = Object.keys(MODIFICATIONS);
|
|
79
|
-
codes = codes.concat(dropdowns).concat(DELIMITER);
|
|
80
|
-
while (i < sequence.length) {
|
|
81
|
-
const code = codes.find((s: string) => s === sequence.slice(i, i + s.length))!;
|
|
82
|
-
i += code.length;
|
|
83
|
-
inverted ? codesList.unshift(code) : codesList.push(code);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const monomers: string[] = [];
|
|
87
|
-
|
|
88
|
-
for (let i = 0; i < codesList.length; i++) {
|
|
89
|
-
if (links.includes(codesList[i]) ||
|
|
90
|
-
includesStandardLinkAlready.includes(codesList[i]) ||
|
|
91
|
-
(i < codesList.length - 1 && links.includes(codesList[i + 1]))
|
|
92
|
-
)
|
|
93
|
-
monomers.push(monomerNameFromCode[codesList[i]]);
|
|
94
|
-
else {
|
|
95
|
-
monomers.push(monomerNameFromCode[codesList[i]]);
|
|
96
|
-
monomers.push('p linkage');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return getMonomerWorks()?.getAtomicLevel(monomers, 'RNA')!;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function sequenceToSmiles(sequence: string, inverted: boolean = false, format: string): string {
|
|
104
|
-
const obj = getObjectWithCodesAndSmiles(sequence, format);
|
|
105
|
-
let codes = sortByStringLengthInDescendingOrder(Object.keys(obj));
|
|
106
|
-
let i = 0;
|
|
107
|
-
let smiles = '';
|
|
108
|
-
const codesList = [];
|
|
109
|
-
const links = ['s', 'ps', '*'];
|
|
110
|
-
const includesStandardLinkAlready = ['e', 'h', /*'g',*/ 'f', 'i', 'l', 'k', 'j'];
|
|
111
|
-
const dropdowns = Object.keys(MODIFICATIONS);
|
|
112
|
-
codes = codes.concat(dropdowns).concat(DELIMITER);
|
|
113
|
-
while (i < sequence.length) {
|
|
114
|
-
const code = codes.find((s: string) => s == sequence.slice(i, i + s.length))!;
|
|
115
|
-
i += code.length;
|
|
116
|
-
inverted ? codesList.unshift(code) : codesList.push(code);
|
|
117
|
-
}
|
|
118
|
-
for (let i = 0; i < codesList.length; i++) {
|
|
119
|
-
if (dropdowns.includes(codesList[i])) {
|
|
120
|
-
smiles += (i >= codesList.length / 2) ?
|
|
121
|
-
MODIFICATIONS[codesList[i]].right + standardPhosphateLinkSmiles :
|
|
122
|
-
MODIFICATIONS[codesList[i]].left + standardPhosphateLinkSmiles;
|
|
123
|
-
} else {
|
|
124
|
-
if (links.includes(codesList[i]) ||
|
|
125
|
-
includesStandardLinkAlready.includes(codesList[i]) ||
|
|
126
|
-
(i < codesList.length - 1 && links.includes(codesList[i + 1]))
|
|
127
|
-
)
|
|
128
|
-
smiles += obj[codesList[i]];
|
|
129
|
-
else
|
|
130
|
-
smiles += obj[codesList[i]] + standardPhosphateLinkSmiles;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
smiles = smiles.replace(/OO/g, 'O');
|
|
134
|
-
return (
|
|
135
|
-
(
|
|
136
|
-
links.includes(codesList[codesList.length - 1]) &&
|
|
137
|
-
codesList.length > 1 &&
|
|
138
|
-
!includesStandardLinkAlready.includes(codesList[codesList.length - 2])
|
|
139
|
-
) ||
|
|
140
|
-
dropdowns.includes(codesList[codesList.length - 1]) ||
|
|
141
|
-
includesStandardLinkAlready.includes(codesList[codesList.length - 1])
|
|
142
|
-
) ?
|
|
143
|
-
smiles :
|
|
144
|
-
smiles.slice(0, smiles.length - standardPhosphateLinkSmiles.length + 1);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function getCodeToNameMap(sequence: string, format: string) {
|
|
148
|
-
const obj: { [code: string]: string } = {};
|
|
149
|
-
const NAME = 'name';
|
|
150
|
-
if (format == null) {
|
|
151
|
-
for (const synthesizer of Object.keys(map)) {
|
|
152
|
-
for (const technology of Object.keys(map[synthesizer])) {
|
|
153
|
-
for (const code of Object.keys(map[synthesizer][technology]))
|
|
154
|
-
obj[code] = map[synthesizer][technology][code][NAME]!;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
} else {
|
|
158
|
-
for (const technology of Object.keys(map[format])) {
|
|
159
|
-
for (const code of Object.keys(map[format][technology]))
|
|
160
|
-
obj[code] = map[format][technology][code][NAME]!;
|
|
161
|
-
// obj[code] = map[format][technology][code].SMILES;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
obj[DELIMITER] = '';
|
|
165
|
-
// TODO: create object based from synthesizer type to avoid key(codes) duplicates
|
|
166
|
-
const output = isValidSequence(sequence, format);
|
|
167
|
-
if (output.synthesizer!.includes(SYNTHESIZERS.MERMADE_12))
|
|
168
|
-
obj['g'] = map[SYNTHESIZERS.MERMADE_12][TECHNOLOGIES.SI_RNA]['g'][NAME]!;
|
|
169
|
-
else if (output.synthesizer!.includes(SYNTHESIZERS.AXOLABS))
|
|
170
|
-
obj['g'] = map[SYNTHESIZERS.AXOLABS][TECHNOLOGIES.SI_RNA]['g'][NAME]!;
|
|
171
|
-
return obj;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function getObjectWithCodesAndSmiles(sequence: string, format: string) {
|
|
175
|
-
const obj: { [code: string]: string } = {};
|
|
176
|
-
if (format == null) {
|
|
177
|
-
for (const synthesizer of Object.keys(map)) {
|
|
178
|
-
for (const technology of Object.keys(map[synthesizer])) {
|
|
179
|
-
for (const code of Object.keys(map[synthesizer][technology]))
|
|
180
|
-
obj[code] = map[synthesizer][technology][code].SMILES;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
for (const technology of Object.keys(map[format])) {
|
|
185
|
-
for (const code of Object.keys(map[format][technology]))
|
|
186
|
-
obj[code] = map[format][technology][code].SMILES;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
obj[DELIMITER] = '';
|
|
190
|
-
// TODO: create object based from synthesizer type to avoid key(codes) duplicates
|
|
191
|
-
const output = isValidSequence(sequence, format);
|
|
192
|
-
if (output.synthesizer!.includes(SYNTHESIZERS.MERMADE_12))
|
|
193
|
-
obj['g'] = map[SYNTHESIZERS.MERMADE_12][TECHNOLOGIES.SI_RNA]['g'].SMILES;
|
|
194
|
-
else if (output.synthesizer!.includes(SYNTHESIZERS.AXOLABS))
|
|
195
|
-
obj['g'] = map[SYNTHESIZERS.AXOLABS][TECHNOLOGIES.SI_RNA]['g'].SMILES;
|
|
196
|
-
return obj;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function getObjectWithCodesAndMolsFromFile(sequence: string, format: string, libFileContent: string) {
|
|
200
|
-
const obj: { [code: string]: string } = {};
|
|
201
|
-
// todo: type
|
|
202
|
-
const lib: any[] = JSON.parse(libFileContent); //consider using library
|
|
203
|
-
|
|
204
|
-
for (const item of lib) {
|
|
205
|
-
for (const synthesizer of Object.keys(item[CODES])) {
|
|
206
|
-
if (synthesizer === format) {
|
|
207
|
-
for (const technology of Object.keys(item[CODES][synthesizer])) {
|
|
208
|
-
const codes = item[CODES][synthesizer][technology];
|
|
209
|
-
let mol: string = item[MOL];
|
|
210
|
-
// todo: find another solution
|
|
211
|
-
mol = mol.replace(/ R /g, ' O ');
|
|
212
|
-
|
|
213
|
-
for (const code of codes)
|
|
214
|
-
obj[code] = mol;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
obj[DELIMITER] = '';
|
|
221
|
-
// TODO: create object based on synthesizer type to avoid key(codes) duplicates
|
|
222
|
-
const output = isValidSequence(sequence, format);
|
|
223
|
-
if (output.synthesizer!.includes(SYNTHESIZERS.MERMADE_12)) {
|
|
224
|
-
// todo: remove as quickfix, optimize access to 'g'
|
|
225
|
-
for (const item of lib) {
|
|
226
|
-
for (const synthesizer of Object.keys(item[CODES])) {
|
|
227
|
-
for (const technology of Object.keys(item[CODES][synthesizer])) {
|
|
228
|
-
const codes = item[CODES][synthesizer][technology];
|
|
229
|
-
for (const code of codes) {
|
|
230
|
-
const condition =
|
|
231
|
-
(code === 'g') &&
|
|
232
|
-
(synthesizer === SYNTHESIZERS.MERMADE_12) &&
|
|
233
|
-
(technology === TECHNOLOGIES.SI_RNA);
|
|
234
|
-
if (condition) {
|
|
235
|
-
let mol: string = item[MOL];
|
|
236
|
-
// todo: find another solution
|
|
237
|
-
mol = mol.replace(/ R /g, ' O ');
|
|
238
|
-
obj[code] = mol;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
} else if (output.synthesizer!.includes(SYNTHESIZERS.AXOLABS)) {
|
|
245
|
-
for (const item of lib) {
|
|
246
|
-
for (const synthesizer of Object.keys(item[CODES])) {
|
|
247
|
-
for (const technology of Object.keys(item[CODES][synthesizer])) {
|
|
248
|
-
const codes = item[CODES][synthesizer][technology];
|
|
249
|
-
for (const code of codes) {
|
|
250
|
-
const condition =
|
|
251
|
-
(code === 'g') &&
|
|
252
|
-
(synthesizer === SYNTHESIZERS.AXOLABS) &&
|
|
253
|
-
(technology === TECHNOLOGIES.SI_RNA);
|
|
254
|
-
if (condition) {
|
|
255
|
-
let mol: string = item[MOL];
|
|
256
|
-
// todo: find another solution
|
|
257
|
-
mol = mol.replace(/ R /g, ' O ');
|
|
258
|
-
obj[code] = mol;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return obj;
|
|
266
|
-
}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
<html><head><meta charset="utf-8"/><title>SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=6288c2fbe346. Commit 695b7b55.</title><style type="text/css">html,
|
|
2
|
-
body {
|
|
3
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
4
|
-
font-size: 1rem;
|
|
5
|
-
margin: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
color: #333;
|
|
8
|
-
}
|
|
9
|
-
body {
|
|
10
|
-
padding: 2rem 1rem;
|
|
11
|
-
font-size: 0.85rem;
|
|
12
|
-
}
|
|
13
|
-
#jesthtml-content {
|
|
14
|
-
margin: 0 auto;
|
|
15
|
-
max-width: 70rem;
|
|
16
|
-
}
|
|
17
|
-
header {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
21
|
-
#title {
|
|
22
|
-
margin: 0;
|
|
23
|
-
flex-grow: 1;
|
|
24
|
-
}
|
|
25
|
-
#logo {
|
|
26
|
-
height: 4rem;
|
|
27
|
-
}
|
|
28
|
-
#timestamp {
|
|
29
|
-
color: #777;
|
|
30
|
-
margin-top: 0.5rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** SUMMARY */
|
|
34
|
-
#summary {
|
|
35
|
-
color: #333;
|
|
36
|
-
margin: 2rem 0;
|
|
37
|
-
display: flex;
|
|
38
|
-
font-family: monospace;
|
|
39
|
-
font-size: 1rem;
|
|
40
|
-
}
|
|
41
|
-
#summary > div {
|
|
42
|
-
margin-right: 2rem;
|
|
43
|
-
background: #eee;
|
|
44
|
-
padding: 1rem;
|
|
45
|
-
min-width: 15rem;
|
|
46
|
-
}
|
|
47
|
-
#summary > div:last-child {
|
|
48
|
-
margin-right: 0;
|
|
49
|
-
}
|
|
50
|
-
@media only screen and (max-width: 720px) {
|
|
51
|
-
#summary {
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
}
|
|
54
|
-
#summary > div {
|
|
55
|
-
margin-right: 0;
|
|
56
|
-
margin-top: 2rem;
|
|
57
|
-
}
|
|
58
|
-
#summary > div:first-child {
|
|
59
|
-
margin-top: 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.summary-total {
|
|
64
|
-
font-weight: bold;
|
|
65
|
-
margin-bottom: 0.5rem;
|
|
66
|
-
}
|
|
67
|
-
.summary-passed {
|
|
68
|
-
color: #4f8a10;
|
|
69
|
-
border-left: 0.4rem solid #4f8a10;
|
|
70
|
-
padding-left: 0.5rem;
|
|
71
|
-
}
|
|
72
|
-
.summary-failed,
|
|
73
|
-
.summary-obsolete-snapshots {
|
|
74
|
-
color: #d8000c;
|
|
75
|
-
border-left: 0.4rem solid #d8000c;
|
|
76
|
-
padding-left: 0.5rem;
|
|
77
|
-
}
|
|
78
|
-
.summary-pending {
|
|
79
|
-
color: #9f6000;
|
|
80
|
-
border-left: 0.4rem solid #9f6000;
|
|
81
|
-
padding-left: 0.5rem;
|
|
82
|
-
}
|
|
83
|
-
.summary-empty {
|
|
84
|
-
color: #999;
|
|
85
|
-
border-left: 0.4rem solid #999;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.test-result {
|
|
89
|
-
padding: 1rem;
|
|
90
|
-
margin-bottom: 0.25rem;
|
|
91
|
-
}
|
|
92
|
-
.test-result:last-child {
|
|
93
|
-
border: 0;
|
|
94
|
-
}
|
|
95
|
-
.test-result.passed {
|
|
96
|
-
background-color: #dff2bf;
|
|
97
|
-
color: #4f8a10;
|
|
98
|
-
}
|
|
99
|
-
.test-result.failed {
|
|
100
|
-
background-color: #ffbaba;
|
|
101
|
-
color: #d8000c;
|
|
102
|
-
}
|
|
103
|
-
.test-result.pending {
|
|
104
|
-
background-color: #ffdf61;
|
|
105
|
-
color: #9f6000;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.test-info {
|
|
109
|
-
display: flex;
|
|
110
|
-
justify-content: space-between;
|
|
111
|
-
}
|
|
112
|
-
.test-suitename {
|
|
113
|
-
width: 20%;
|
|
114
|
-
text-align: left;
|
|
115
|
-
font-weight: bold;
|
|
116
|
-
word-break: break-word;
|
|
117
|
-
}
|
|
118
|
-
.test-title {
|
|
119
|
-
width: 40%;
|
|
120
|
-
text-align: left;
|
|
121
|
-
font-style: italic;
|
|
122
|
-
}
|
|
123
|
-
.test-status {
|
|
124
|
-
width: 20%;
|
|
125
|
-
text-align: right;
|
|
126
|
-
}
|
|
127
|
-
.test-duration {
|
|
128
|
-
width: 10%;
|
|
129
|
-
text-align: right;
|
|
130
|
-
font-size: 0.75rem;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.failureMessages {
|
|
134
|
-
padding: 0 1rem;
|
|
135
|
-
margin-top: 1rem;
|
|
136
|
-
border-top: 1px dashed #d8000c;
|
|
137
|
-
}
|
|
138
|
-
.failureMessages.suiteFailure {
|
|
139
|
-
border-top: none;
|
|
140
|
-
}
|
|
141
|
-
.failureMsg {
|
|
142
|
-
white-space: pre-wrap;
|
|
143
|
-
white-space: -moz-pre-wrap;
|
|
144
|
-
white-space: -pre-wrap;
|
|
145
|
-
white-space: -o-pre-wrap;
|
|
146
|
-
word-wrap: break-word;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.suite-container {
|
|
150
|
-
margin-bottom: 2rem;
|
|
151
|
-
}
|
|
152
|
-
.suite-info {
|
|
153
|
-
padding: 1rem;
|
|
154
|
-
background-color: #eee;
|
|
155
|
-
color: #777;
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
margin-bottom: 0.25rem;
|
|
159
|
-
}
|
|
160
|
-
.suite-info .suite-path {
|
|
161
|
-
word-break: break-all;
|
|
162
|
-
flex-grow: 1;
|
|
163
|
-
font-family: monospace;
|
|
164
|
-
font-size: 1rem;
|
|
165
|
-
}
|
|
166
|
-
.suite-info .suite-time {
|
|
167
|
-
margin-left: 0.5rem;
|
|
168
|
-
padding: 0.2rem 0.3rem;
|
|
169
|
-
font-size: 0.75rem;
|
|
170
|
-
}
|
|
171
|
-
.suite-info .suite-time.warn {
|
|
172
|
-
background-color: #d8000c;
|
|
173
|
-
color: #fff;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* CONSOLE LOGS */
|
|
177
|
-
.suite-consolelog {
|
|
178
|
-
margin-bottom: 0.25rem;
|
|
179
|
-
padding: 1rem;
|
|
180
|
-
background-color: #efefef;
|
|
181
|
-
}
|
|
182
|
-
.suite-consolelog-header {
|
|
183
|
-
font-weight: bold;
|
|
184
|
-
}
|
|
185
|
-
.suite-consolelog-item {
|
|
186
|
-
padding: 0.5rem;
|
|
187
|
-
}
|
|
188
|
-
.suite-consolelog-item pre {
|
|
189
|
-
margin: 0.5rem 0;
|
|
190
|
-
white-space: pre-wrap;
|
|
191
|
-
white-space: -moz-pre-wrap;
|
|
192
|
-
white-space: -pre-wrap;
|
|
193
|
-
white-space: -o-pre-wrap;
|
|
194
|
-
word-wrap: break-word;
|
|
195
|
-
}
|
|
196
|
-
.suite-consolelog-item-origin {
|
|
197
|
-
color: #777;
|
|
198
|
-
font-weight: bold;
|
|
199
|
-
}
|
|
200
|
-
.suite-consolelog-item-message {
|
|
201
|
-
color: #000;
|
|
202
|
-
font-size: 1rem;
|
|
203
|
-
padding: 0 0.5rem;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/* OBSOLETE SNAPSHOTS */
|
|
207
|
-
.suite-obsolete-snapshots {
|
|
208
|
-
margin-bottom: 0.25rem;
|
|
209
|
-
padding: 1rem;
|
|
210
|
-
background-color: #ffbaba;
|
|
211
|
-
color: #d8000c;
|
|
212
|
-
}
|
|
213
|
-
.suite-obsolete-snapshots-header {
|
|
214
|
-
font-weight: bold;
|
|
215
|
-
}
|
|
216
|
-
.suite-obsolete-snapshots-item {
|
|
217
|
-
padding: 0.5rem;
|
|
218
|
-
}
|
|
219
|
-
.suite-obsolete-snapshots-item pre {
|
|
220
|
-
margin: 0.5rem 0;
|
|
221
|
-
white-space: pre-wrap;
|
|
222
|
-
white-space: -moz-pre-wrap;
|
|
223
|
-
white-space: -pre-wrap;
|
|
224
|
-
white-space: -o-pre-wrap;
|
|
225
|
-
word-wrap: break-word;
|
|
226
|
-
}
|
|
227
|
-
.suite-obsolete-snapshots-item-message {
|
|
228
|
-
color: #000;
|
|
229
|
-
font-size: 1rem;
|
|
230
|
-
padding: 0 0.5rem;
|
|
231
|
-
}
|
|
232
|
-
</style></head><body><div id="jesthtml-content"><header><h1 id="title">SequenceTranslator Test Report. Datagrok version datagrok/datagrok:latest SHA=6288c2fbe346. Commit 695b7b55.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-12-19 15:46:37</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (1)</div><div class="summary-passed">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><div class="suite-info"><div class="suite-path">/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts</div><div class="suite-time warn">15.201s</div></div><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename"> </div><div class="test-title">TEST</div><div class="test-status">passed</div><div class="test-duration">4.324s</div></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.<anonymous> (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/test-node.ts:62:11)
|
|
233
|
-
at Generator.next (<anonymous>)
|
|
234
|
-
at fulfilled (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/test-node.ts:28:58)
|
|
235
|
-
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:40:11
|
|
236
|
-
at Generator.next (<anonymous>)
|
|
237
|
-
at /home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:34:71
|
|
238
|
-
at new Promise (<anonymous>)
|
|
239
|
-
at Object.<anonymous>.__awaiter (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:30:12)
|
|
240
|
-
at Object.<anonymous> (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:38:23)
|
|
241
|
-
at Promise.then.completed (/home/runner/work/public/public/packages/SequenceTranslator/node_modules/jest-circus/build/utils.js:391:28)
|
|
242
|
-
at new Promise (<anonymous>)</pre><pre class="suite-consolelog-item-message">Testing SequenceTranslator package</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:72:11
|
|
243
|
-
at Generator.next (<anonymous>)
|
|
244
|
-
at fulfilled (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:31:58)
|
|
245
|
-
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Test result : Success : 2 : SequenceTranslator.sequence-translator.usCfCfUfGfAf : OK
|
|
246
|
-
Test result : Success : 1 : SequenceTranslator.sequence-translator.usAfsusgsgsg : OK
|
|
247
|
-
Test result : Success : 1 : SequenceTranslator.sequence-translator.UfUfUfsCfsuacg : OK
|
|
248
|
-
Test result : Success : 0 : SequenceTranslator.sequence-translator.susususauasu : OK
|
|
249
|
-
Test result : Success : 1 : SequenceTranslator.sequence-translator.CfGfCfsGfsCf : OK
|
|
250
|
-
Test result : Success : 0 : SequenceTranslator.sequence-translator.acacacsacsac : OK
|
|
251
|
-
Test result : Success : 0 : SequenceTranslator.sequence-translator.cccgggusug : OK
|
|
252
|
-
Test result : Success : 0 : SequenceTranslator.sequence-translator.UfAfCfGfGfCfAfUf : OK
|
|
253
|
-
Test result : Success : 1 : SequenceTranslator.sequence-translator.(invabasic)cuCfuUfsc : OK
|
|
254
|
-
Test result : Success : 1 : SequenceTranslator.sequence-translator.(invabasic)usAfsucuCfuUfAfgcugUfgCfacususu : OK
|
|
255
|
-
Test result : Success : 1 : SequenceTranslator.sequence-translator.(invabasic)asacgGfuGfCfAfacucuauuca : OK
|
|
256
|
-
</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:74:11
|
|
257
|
-
at Generator.next (<anonymous>)
|
|
258
|
-
at fulfilled (/home/runner/work/public/public/packages/SequenceTranslator/src/__jest__/remote.test.ts:31:58)
|
|
259
|
-
at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message"/></div></div></div></div></body></html>
|