@datagrok/sequence-translator 1.9.7 → 1.9.9

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.
@@ -1,833 +0,0 @@
1
- var sequencetranslator;
2
- /******/ (() => { // webpackBootstrap
3
- /******/ "use strict";
4
- /******/ var __webpack_modules__ = ({
5
-
6
- /***/ "./node_modules/@datagrok-libraries/bio/src/helm/consts.js":
7
- /*!*****************************************************************!*\
8
- !*** ./node_modules/@datagrok-libraries/bio/src/helm/consts.js ***!
9
- \*****************************************************************/
10
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
11
-
12
- __webpack_require__.r(__webpack_exports__);
13
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14
- /* harmony export */ HelmTypes: () => (/* reexport safe */ _datagrok_libraries_js_draw_lite_src_types_org__WEBPACK_IMPORTED_MODULE_0__.HelmTypes)
15
- /* harmony export */ });
16
- /* harmony import */ var _datagrok_libraries_js_draw_lite_src_types_org__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @datagrok-libraries/js-draw-lite/src/types/org */ "./node_modules/@datagrok-libraries/js-draw-lite/src/types/org.js");
17
-
18
-
19
- //# sourceMappingURL=consts.js.map
20
-
21
- /***/ }),
22
-
23
- /***/ "./node_modules/@datagrok-libraries/bio/src/monomer-works/consts.js":
24
- /*!**************************************************************************!*\
25
- !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/consts.js ***!
26
- \**************************************************************************/
27
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
28
-
29
- __webpack_require__.r(__webpack_exports__);
30
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31
- /* harmony export */ monomerWorksConsts: () => (/* binding */ monomerWorksConsts)
32
- /* harmony export */ });
33
- const monomerWorksConsts = {
34
- // constants for parsing molfile V2000
35
- V2K_RGP_SHIFT: 8,
36
- V2K_RGP_LINE: 'M RGP',
37
- V2K_A_LINE: 'A ',
38
- // constants for parsing/reconstruction of molfile V3000
39
- V3K_COUNTS_SHIFT: 14,
40
- V3K_IDX_SHIFT: 7,
41
- V3K_HEADER_FIRST_LINE: '\nDatagrok macromolecule handler\n\n',
42
- V3K_HEADER_SECOND_LINE: ' 0 0 0 0 0 0 999 V3000\n',
43
- V3K_BEGIN_CTAB_BLOCK: 'M V30 BEGIN CTAB\n',
44
- V3K_END_CTAB_BLOCK: 'M V30 END CTAB\n',
45
- V3K_BEGIN_COUNTS_LINE: 'M V30 COUNTS ',
46
- V3K_COUNTS_LINE_ENDING: ' 0 0 0\n',
47
- V3K_BEGIN_ATOM_BLOCK: 'M V30 BEGIN ATOM\n',
48
- V3K_END_ATOM_BLOCK: 'M V30 END ATOM\n',
49
- V3K_BEGIN_BOND_BLOCK: 'M V30 BEGIN BOND\n',
50
- V3K_END_BOND_BLOCK: 'M V30 END BOND\n',
51
- V3K_BOND_CONFIG: ' CFG=',
52
- V3K_BEGIN_DATA_LINE: 'M V30 ',
53
- V3K_END: 'M END',
54
- PRECISION_FACTOR: 10000, // HELMCoreLibrary has 4 significant digits after decimal point in atom coordinates
55
- // symbols for the corresponding monomers in HELM library
56
- DEOXYRIBOSE: { polymerType: "RNA" /* PolymerTypes.RNA */, symbol: 'd' },
57
- RIBOSE: { polymerType: "RNA" /* PolymerTypes.RNA */, symbol: 'r' },
58
- PHOSPHATE: { polymerType: "RNA" /* PolymerTypes.RNA */, symbol: 'p' },
59
- OXYGEN: 'O',
60
- HYDROGEN: 'H',
61
- };
62
- //# sourceMappingURL=consts.js.map
63
-
64
- /***/ }),
65
-
66
- /***/ "./node_modules/@datagrok-libraries/bio/src/monomer-works/monomer-works.js":
67
- /*!*********************************************************************************!*\
68
- !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/monomer-works.js ***!
69
- \*********************************************************************************/
70
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
71
-
72
- __webpack_require__.r(__webpack_exports__);
73
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
74
- /* harmony export */ MonomerWorks: () => (/* binding */ MonomerWorks),
75
- /* harmony export */ helmTypeToPolymerType: () => (/* binding */ helmTypeToPolymerType)
76
- /* harmony export */ });
77
- /* harmony import */ var _helm_consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helm/consts */ "./node_modules/@datagrok-libraries/bio/src/helm/consts.js");
78
-
79
- class MonomerWorks {
80
- //private molfileConverter: IMolfileConverter;
81
- constructor(monomerLib /*, molfileConverter: IMolfileConverter*/) {
82
- this.monomerLib = monomerLib;
83
- //this.molfileConverter = molfileConverter;
84
- }
85
- //types according to Monomer possible
86
- getCappedRotatedMonomer(monomerType, monomerName) {
87
- // TODO: Check type of monomerType arg
88
- const monomer = this.monomerLib.getMonomer(monomerType, monomerName);
89
- if (monomer)
90
- return monomer.molfile; //TODO cap
91
- return null;
92
- }
93
- }
94
- function helmTypeToPolymerType(helmType) {
95
- let polymerType = undefined;
96
- switch (helmType) {
97
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.BASE:
98
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.SUGAR: // r - ribose, d - deoxyribose
99
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.LINKER: // p - phosphate
100
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.NUCLEOTIDE:
101
- // @ts-ignore
102
- case 'nucleotide':
103
- polymerType = "RNA" /* PolymerTypes.RNA */;
104
- break;
105
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.AA:
106
- polymerType = "PEPTIDE" /* PolymerTypes.PEPTIDE */;
107
- break;
108
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.CHEM:
109
- polymerType = "CHEM" /* PolymerTypes.CHEM */;
110
- break;
111
- case _helm_consts__WEBPACK_IMPORTED_MODULE_0__.HelmTypes.BLOB:
112
- polymerType = "BLOB" /* PolymerTypes.BLOB */;
113
- break;
114
- default:
115
- polymerType = "PEPTIDE" /* PolymerTypes.PEPTIDE */;
116
- console.warn(`Unexpected HelmType '${helmType}'`);
117
- }
118
- return polymerType;
119
- }
120
- //# sourceMappingURL=monomer-works.js.map
121
-
122
- /***/ }),
123
-
124
- /***/ "./node_modules/@datagrok-libraries/bio/src/monomer-works/to-atomic-level-utils.js":
125
- /*!*****************************************************************************************!*\
126
- !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/to-atomic-level-utils.js ***!
127
- \*****************************************************************************************/
128
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
129
-
130
- __webpack_require__.r(__webpack_exports__);
131
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
132
- /* harmony export */ getFormattedMonomerLib: () => (/* binding */ getFormattedMonomerLib),
133
- /* harmony export */ keepPrecision: () => (/* binding */ keepPrecision),
134
- /* harmony export */ monomerSeqToMolfile: () => (/* binding */ monomerSeqToMolfile)
135
- /* harmony export */ });
136
- /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./consts */ "./node_modules/@datagrok-libraries/bio/src/monomer-works/consts.js");
137
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./node_modules/@datagrok-libraries/bio/src/monomer-works/types.js");
138
- /* harmony import */ var _utils_const__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/const */ "./node_modules/@datagrok-libraries/bio/src/utils/const.js");
139
- /* harmony import */ var _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/macromolecule/consts */ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/consts.js");
140
- /* harmony import */ var _monomer_works__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./monomer-works */ "./node_modules/@datagrok-libraries/bio/src/monomer-works/monomer-works.js");
141
- /* eslint-disable max-len */
142
-
143
-
144
-
145
-
146
-
147
- /** Get a mapping of peptide symbols to HELM monomer library objects with selected fields.
148
- * @param {IMonomerLib} monomerLib - Monomer library
149
- * @param {HELM_POLYMER_TYPE} polymerType - Polymer type
150
- * @param {ALPHABET} alphabet - Alphabet of the column
151
- * @return {Map<string, any>} - Mapping of peptide symbols to HELM monomer library objects with selected fields*/
152
- function getFormattedMonomerLib(monomerLib, polymerType, alphabet) {
153
- const map = new Map();
154
- for (const monomerSymbol of monomerLib.getMonomerSymbolsByType(polymerType)) {
155
- const it = monomerLib.getMonomer(polymerType, monomerSymbol);
156
- if (polymerType === "RNA" /* HELM_POLYMER_TYPE.RNA */ &&
157
- (it["monomerType" /* HELM_FIELDS.MONOMER_TYPE */] === "Branch" /* HELM_MONOMER_TYPE.BRANCH */ ||
158
- alphabet === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.ALPHABET.DNA && it["symbol" /* HELM_FIELDS.SYMBOL */] === _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.DEOXYRIBOSE.symbol ||
159
- alphabet === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.ALPHABET.RNA && it["symbol" /* HELM_FIELDS.SYMBOL */] === _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.RIBOSE.symbol ||
160
- it["symbol" /* HELM_FIELDS.SYMBOL */] === _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PHOSPHATE.symbol) ||
161
- polymerType === "PEPTIDE" /* HELM_POLYMER_TYPE.PEPTIDE */ &&
162
- it["monomerType" /* HELM_FIELDS.MONOMER_TYPE */] !== "Branch" /* HELM_MONOMER_TYPE.BRANCH */) {
163
- const monomerObject = {};
164
- _utils_const__WEBPACK_IMPORTED_MODULE_2__.HELM_CORE_FIELDS.forEach((field) => {
165
- //@ts-ignore
166
- monomerObject[field] = it[field];
167
- });
168
- map.set(it["symbol" /* HELM_FIELDS.SYMBOL */], monomerObject);
169
- }
170
- }
171
- return map;
172
- }
173
- /** Translate a sequence of monomer symbols into Molfile V3000
174
- * @param {string[]} monomerSeq - Sequence of monomer symbols (canonical)
175
- * @param {Map<string, MolGraph>} monomersDict - Mapping of monomer symbols to MolGraph objects
176
- * @param {ALPHABET} alphabet - Alphabet of the column
177
- * @param {PolymerType} polymerType - Polymer type
178
- * @return {string} - Molfile V3000*/
179
- function monomerSeqToMolfile(monomerSeq, monomersDict, alphabet, polymerType) {
180
- if (monomerSeq.length === 0) {
181
- // throw new Error('monomerSeq is empty');
182
- return _types__WEBPACK_IMPORTED_MODULE_1__.MolfileWithMap.createEmpty();
183
- }
184
- // define atom and bond counts, taking into account the bond type
185
- const getAtomAndBondCounts = getResultingAtomBondCounts;
186
- const { atomCount, bondCount, needsCapping } = getAtomAndBondCounts(monomerSeq, monomersDict, alphabet, polymerType);
187
- // create arrays to store lines of the resulting molfile
188
- const molfileAtomBlock = new Array(atomCount);
189
- const molfileBondBlock = new Array(bondCount);
190
- let addMonomerToMolblock;
191
- let sugar = null;
192
- let phosphate = null;
193
- if (polymerType === "PEPTIDE" /* HELM_POLYMER_TYPE.PEPTIDE */)
194
- addMonomerToMolblock = addAminoAcidToMolblock;
195
- else { // nucleotides
196
- addMonomerToMolblock = addNucleotideToMolblock;
197
- sugar = (alphabet === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.ALPHABET.DNA) ? (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.DEOXYRIBOSE) : (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.RIBOSE);
198
- phosphate = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PHOSPHATE);
199
- }
200
- const v = {
201
- i: 0,
202
- nodeShift: 0,
203
- bondShift: 0,
204
- backbonePositionShift: new Array(2).fill(0),
205
- branchPositionShift: new Array(2).fill(0),
206
- backboneAttachNode: 0,
207
- branchAttachNode: 0,
208
- flipFactor: 1,
209
- };
210
- const LC = {
211
- sugar: sugar,
212
- phosphate: phosphate,
213
- seqLength: monomerSeq.length,
214
- atomCount: atomCount,
215
- bondCount: bondCount,
216
- };
217
- const monomers = new _types__WEBPACK_IMPORTED_MODULE_1__.MonomerMap();
218
- const steabsCollection = [];
219
- let nAtoms = 0;
220
- let lastMonomerCappingAtom = undefined;
221
- for (v.i = 0; v.i < LC.seqLength; ++v.i) {
222
- const seqMonomer = monomerSeq[v.i];
223
- if (seqMonomer.symbol === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.GAP_SYMBOL)
224
- continue;
225
- const monomer = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, { symbol: seqMonomer.symbol, polymerType: (0,_monomer_works__WEBPACK_IMPORTED_MODULE_4__.helmTypeToPolymerType)(seqMonomer.biotype) });
226
- lastMonomerCappingAtom = monomer.terminalR2Atom;
227
- const mAtomFirst = v.nodeShift;
228
- const mBondFirst = v.bondShift;
229
- addMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v, LC);
230
- //adding stereo atoms to array for further STEABS block generation
231
- monomer.stereoAtoms?.forEach((i) => steabsCollection.push(i + nAtoms));
232
- nAtoms += monomer.atoms.x.length;
233
- const mAtomCount = v.nodeShift - mAtomFirst;
234
- const mAtomList = new Array(mAtomCount);
235
- for (let maI = 0; maI < mAtomCount; ++maI)
236
- mAtomList[maI] = mAtomFirst + maI;
237
- const mBondCount = v.bondShift - mBondFirst;
238
- const mBondList = new Array(mBondCount);
239
- for (let mbI = 0; mbI < mBondCount; ++mbI)
240
- mBondList[mbI] = mBondFirst + mbI;
241
- monomers.set(v.i, {
242
- biotype: seqMonomer.biotype,
243
- symbol: seqMonomer.symbol,
244
- atoms: mAtomList, bonds: mBondList
245
- });
246
- }
247
- // if the last monomer needs to be capped, add the terminal OH to the resulting molfile
248
- if (needsCapping)
249
- capResultingMolblock(molfileAtomBlock, molfileBondBlock, v, LC, lastMonomerCappingAtom ?? _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.OXYGEN);
250
- const molfileCountsLine = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_COUNTS_LINE + atomCount + ' ' + bondCount + _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_COUNTS_LINE_ENDING;
251
- // todo: possible optimization may be achieved by replacing .join('') with +=
252
- // since counterintuitively joining an array into a new string is reportedly
253
- // slower than using += as below
254
- let result = '';
255
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_HEADER_FIRST_LINE;
256
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_HEADER_SECOND_LINE;
257
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_CTAB_BLOCK;
258
- result += molfileCountsLine;
259
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_ATOM_BLOCK;
260
- result += molfileAtomBlock.join('');
261
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END_ATOM_BLOCK;
262
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_BOND_BLOCK;
263
- result += molfileBondBlock.join('');
264
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END_BOND_BLOCK;
265
- if (steabsCollection.length > 0)
266
- result += getCollectionBlock(steabsCollection);
267
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END_CTAB_BLOCK;
268
- result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END;
269
- // return molfileParts.join('');
270
- return { molfile: result, monomers: monomers };
271
- }
272
- function getCollectionBlock(collection) {
273
- //one row in STEABS block can be no longer than 80 symbols
274
- //maxSymbols = 80 symbols minus ' -\n' (4 symbols)
275
- const maxSymbols = 76;
276
- const rowsArray = [];
277
- let newCollectionRow = `M V30 MDLV30/STEABS ATOMS=(${collection.length}`;
278
- for (let i = 0; i < collection.length; i++) {
279
- const updatedRow = `${newCollectionRow} ${collection[i]}`;
280
- if (updatedRow.length > maxSymbols) {
281
- rowsArray.push(`${newCollectionRow} -\n`);
282
- newCollectionRow = `M V30 ${collection[i]}`;
283
- }
284
- else
285
- newCollectionRow = updatedRow;
286
- //in case last atom was added - close the block
287
- if (i === collection.length - 1)
288
- rowsArray.push(`${newCollectionRow})\n`);
289
- }
290
- return `M V30 BEGIN COLLECTION\n${rowsArray.join('')}M V30 END COLLECTION\n`;
291
- }
292
- /** Cap the resulting (after sewing up all the monomers) molfile with 'O'
293
- * @param {string[]} molfileAtomBlock - Array of lines of the resulting molfile atom block
294
- * @param {string[]} molfileBondBlock - Array of lines of the resulting molfile bond block
295
- * @param {LoopVariables} v - Loop variables
296
- * @param {LoopConstants} LC - Loop constants*/
297
- function capResultingMolblock(molfileAtomBlock, molfileBondBlock, v, LC, cappingAtomType = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.OXYGEN) {
298
- // add terminal oxygen
299
- const atomIdx = v.nodeShift + 1;
300
- molfileAtomBlock[LC.atomCount] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + atomIdx + ' ' +
301
- (cappingAtomType ?? _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.OXYGEN) + ' ' + keepPrecision(v.backbonePositionShift[0]) + ' ' +
302
- v.flipFactor * keepPrecision(v.backbonePositionShift[1]) + ' ' + '0.000000 0' + '\n';
303
- // add terminal bond
304
- const firstAtom = v.backboneAttachNode;
305
- const secondAtom = atomIdx;
306
- molfileBondBlock[LC.bondCount] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + v.bondShift + ' ' +
307
- 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
308
- }
309
- function addAminoAcidToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v) {
310
- v.flipFactor = (-1) ** (v.i % 2); // to flip every even monomer over OX
311
- addBackboneMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v);
312
- }
313
- function addBackboneMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v) {
314
- // todo: remove these comments to the docstrings of the corr. functions
315
- // construnct the lines of V3K molfile atom block
316
- fillAtomLines(monomer, molfileAtomBlock, v);
317
- // construct the lines of V3K molfile bond block
318
- fillBondLines(monomer, molfileBondBlock, v);
319
- // peptide bond
320
- fillChainExtendingBond(monomer, molfileBondBlock, v);
321
- // update branch variables if necessary
322
- if (monomer.meta.branchShift !== null && monomer.meta.terminalNodes.length > 2)
323
- updateBranchVariables(monomer, v);
324
- // update loop variables
325
- updateChainExtendingVariables(monomer, v);
326
- }
327
- function addNucleotideToMolblock(nucleobase, molfileAtomBlock, molfileBondBlock, v, LC) {
328
- // construnct the lines of V3K molfile atom block corresponding to phosphate
329
- // and sugar
330
- if (v.i === 0)
331
- addBackboneMonomerToMolblock(LC.sugar, molfileAtomBlock, molfileBondBlock, v);
332
- else {
333
- for (const monomer of [LC.phosphate, LC.sugar])
334
- addBackboneMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v);
335
- }
336
- addBranchMonomerToMolblock(nucleobase, molfileAtomBlock, molfileBondBlock, v);
337
- }
338
- function addBranchMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v) {
339
- fillBranchAtomLines(monomer, molfileAtomBlock, v);
340
- fillBondLines(monomer, molfileBondBlock, v);
341
- fillBackboneToBranchBond(monomer, molfileBondBlock, v);
342
- // C-N bond
343
- const bondIdx = v.bondShift;
344
- const firstAtom = v.branchAttachNode;
345
- const secondAtom = monomer.meta.terminalNodes[0] + v.nodeShift;
346
- molfileBondBlock[bondIdx - 1] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
347
- 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
348
- // update loop variables
349
- v.bondShift += monomer.bonds.atomPairs.length + 1;
350
- v.nodeShift += monomer.atoms.atomTypes.length;
351
- }
352
- function updateChainExtendingVariables(monomer, v) {
353
- v.backboneAttachNode = v.nodeShift + monomer.meta.terminalNodes[1];
354
- v.bondShift += monomer.bonds.atomPairs.length + 1;
355
- v.nodeShift += monomer.atoms.atomTypes.length;
356
- v.backbonePositionShift[0] += monomer.meta.backboneShift?.[0] ?? 0; // todo: non-null check
357
- v.backbonePositionShift[1] += v.flipFactor * (monomer.meta.backboneShift?.[1] ?? 0);
358
- }
359
- function updateBranchVariables(monomer, v) {
360
- v.branchAttachNode = v.nodeShift + monomer.meta.terminalNodes[2];
361
- for (let i = 0; i < 2; ++i)
362
- v.branchPositionShift[i] = v.backbonePositionShift[i] + monomer.meta.branchShift[i];
363
- }
364
- function fillAtomLines(monomer, molfileAtomBlock, v) {
365
- for (let j = 0; j < monomer.atoms.atomTypes.length; ++j) {
366
- const atomIdx = v.nodeShift + j + 1;
367
- molfileAtomBlock[v.nodeShift + j] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + atomIdx + ' ' +
368
- monomer.atoms.atomTypes[j] + ' ' +
369
- keepPrecision(v.backbonePositionShift[0] + monomer.atoms.x[j]) + ' ' +
370
- keepPrecision(v.backbonePositionShift[1] + v.flipFactor * monomer.atoms.y[j]) +
371
- ' ' + monomer.atoms.kwargs[j];
372
- }
373
- }
374
- // todo: remove as quickfix
375
- function fillBranchAtomLines(monomer, molfileAtomBlock, v) {
376
- for (let j = 0; j < monomer.atoms.atomTypes.length; ++j) {
377
- const atomIdx = v.nodeShift + j + 1;
378
- molfileAtomBlock[v.nodeShift + j] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + atomIdx + ' ' +
379
- monomer.atoms.atomTypes[j] + ' ' +
380
- keepPrecision(v.branchPositionShift[0] + monomer.atoms.x[j]) + ' ' +
381
- keepPrecision(v.branchPositionShift[1] + v.flipFactor * monomer.atoms.y[j]) +
382
- ' ' + monomer.atoms.kwargs[j];
383
- }
384
- }
385
- function fillBondLines(monomer, molfileBondBlock, v) {
386
- // construct the lines of V3K molfile bond block
387
- for (let j = 0; j < monomer.bonds.atomPairs.length; ++j) {
388
- const bondIdx = v.bondShift + j + 1;
389
- const firstAtom = monomer.bonds.atomPairs[j][0] + v.nodeShift;
390
- const secondAtom = monomer.bonds.atomPairs[j][1] + v.nodeShift;
391
- let bondCfg = '';
392
- if (monomer.bonds.bondConfiguration.has(j)) {
393
- // flip orientation when necessary
394
- let orientation = monomer.bonds.bondConfiguration.get(j);
395
- if (v.flipFactor < 0)
396
- orientation = (orientation === 1) ? 3 : 1;
397
- bondCfg = ' CFG=' + orientation;
398
- }
399
- const kwargs = monomer.bonds.kwargs.has(j) ?
400
- ' ' + monomer.bonds.kwargs.get(j) : '';
401
- molfileBondBlock[v.bondShift + j] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
402
- monomer.bonds.bondTypes[j] + ' ' +
403
- firstAtom + ' ' + secondAtom + bondCfg + kwargs + '\n';
404
- }
405
- }
406
- function fillChainExtendingBond(monomer, molfileBondBlock, v) {
407
- if (v.backboneAttachNode !== 0) {
408
- const bondIdx = v.bondShift;
409
- const firstAtom = v.backboneAttachNode;
410
- const secondAtom = monomer.meta.terminalNodes[0] + v.nodeShift;
411
- molfileBondBlock[v.bondShift - 1] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
412
- 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
413
- }
414
- }
415
- // todo: remove
416
- function fillBackboneToBranchBond(branchMonomer, molfileBondBlock, v) {
417
- const bondIdx = v.bondShift;
418
- const firstAtom = v.branchAttachNode;
419
- const secondAtom = branchMonomer.meta.terminalNodes[0] + v.nodeShift;
420
- molfileBondBlock[bondIdx - 1] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
421
- 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
422
- }
423
- /** Compute the atom/bond counts for the resulting molfile, depending on the
424
- * type of polymer (peptide/nucleotide)
425
- * @param {string[]}monomerSeq - the sequence of monomers
426
- * @param {Map<string, MolGraph>}monomersDict - the dictionary of monomers
427
- * @param {ALPHABET}alphabet - the alphabet of the monomers
428
- * @param {HELM_POLYMER_TYPE}polymerType - the type of polymer
429
- * @return {{atomCount: number, bondCount: number}} - the atom/bond counts*/
430
- function getResultingAtomBondCounts(monomerSeq, monomersDict, alphabet, polymerType) {
431
- let atomCount = 0;
432
- let bondCount = 0;
433
- let monomerCount = 0;
434
- let needsCapping = true;
435
- let lastMonomerGraph = null;
436
- // sum up all the atoms/nodes provided by the sequence
437
- for (const seqMonomer of monomerSeq) {
438
- if (seqMonomer.symbol === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.GAP_SYMBOL)
439
- continue; // Skip for gap/empty monomer in MSA
440
- if (seqMonomer.symbol == '*')
441
- throw new Error(`Gap canonical symbol is '', not '*`);
442
- lastMonomerGraph = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, { symbol: seqMonomer.symbol, polymerType: (0,_monomer_works__WEBPACK_IMPORTED_MODULE_4__.helmTypeToPolymerType)(seqMonomer.biotype) });
443
- atomCount += lastMonomerGraph.atoms.x.length;
444
- bondCount += lastMonomerGraph.bonds.bondTypes.length;
445
- monomerCount++;
446
- }
447
- // add extra values depending on the polymer type
448
- if (polymerType === "PEPTIDE" /* HELM_POLYMER_TYPE.PEPTIDE */) {
449
- // add the rightmost/terminating cap group 'OH' (i.e. 'O')
450
- atomCount += 1;
451
- // add chain-extending bonds (C-NH per each monomer pair and terminal C-OH)
452
- bondCount += monomerCount;
453
- // if the last monomer is something like NH2, which only has R1, there is no need to cap it
454
- // although, this should never happen, but hey... in other bits of code, there is a chunk that adds pseudo-R2 as hydrogen
455
- // we should also check, if the R2 of the last monomer is not hydrogen, that case should also be omitted
456
- if (monomerCount > 0) {
457
- if ((lastMonomerGraph?.meta?.rNodes?.length ?? 0) < 2 || lastMonomerGraph?.terminalR2Atom?.toLowerCase() === _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.HYDROGEN.toLowerCase()) {
458
- needsCapping = false;
459
- atomCount -= 1; // remove the last atom (the terminal 'O')
460
- bondCount -= 1; // remove the last bond (the terminal C-OH)
461
- }
462
- }
463
- }
464
- else { // nucleotides
465
- const sugar = (alphabet === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.ALPHABET.DNA) ?
466
- (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.DEOXYRIBOSE) : (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.RIBOSE);
467
- const phosphate = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PHOSPHATE);
468
- // add phosphate per each pair of nucleobase symbols
469
- atomCount += (monomerSeq.length - 1) * phosphate.atoms.x.length;
470
- // add sugar per each nucleobase symbol
471
- atomCount += monomerSeq.length * sugar.atoms.x.length;
472
- // add the leftmost cap group 'OH' (i.e. 'O')
473
- atomCount += 1;
474
- // add bonds from phosphate monomers
475
- bondCount += (monomerSeq.length - 1) * phosphate.bonds.bondTypes.length;
476
- // add bonds from sugar monomers
477
- bondCount += monomerSeq.length * sugar.bonds.bondTypes.length;
478
- // exclude the first chain-extending bond O-P (absent, no 'leftmost' phosphate)
479
- bondCount -= 1;
480
- // add chain-extending and branch bonds (O-P, C-O and C-N per each nucleotide)
481
- bondCount += monomerSeq.length * 3;
482
- }
483
- return { atomCount, bondCount, needsCapping };
484
- }
485
- /** Keep precision upon floating point operations over atom coordinates
486
- * @param {number}x - the floating point number
487
- * @return {number} - the floating point number with the same precision
488
- */
489
- function keepPrecision(x) {
490
- return Math.round(_consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PRECISION_FACTOR * x) / _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PRECISION_FACTOR;
491
- }
492
- //# sourceMappingURL=to-atomic-level-utils.js.map
493
-
494
- /***/ }),
495
-
496
- /***/ "./node_modules/@datagrok-libraries/bio/src/monomer-works/types.js":
497
- /*!*************************************************************************!*\
498
- !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/types.js ***!
499
- \*************************************************************************/
500
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
501
-
502
- __webpack_require__.r(__webpack_exports__);
503
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
504
- /* harmony export */ MolfileWithMap: () => (/* binding */ MolfileWithMap),
505
- /* harmony export */ MonomerMap: () => (/* binding */ MonomerMap),
506
- /* harmony export */ getMolGraph: () => (/* binding */ getMolGraph),
507
- /* harmony export */ hasMolGraph: () => (/* binding */ hasMolGraph),
508
- /* harmony export */ setMolGraph: () => (/* binding */ setMolGraph)
509
- /* harmony export */ });
510
- function getMolGraph(dict, libKey) {
511
- return dict[libKey.polymerType]?.[libKey.symbol];
512
- }
513
- function hasMolGraph(dict, libKey) {
514
- return !!dict[libKey.polymerType]?.[libKey.symbol];
515
- }
516
- function setMolGraph(dict, libKey, value) {
517
- let pt = dict[libKey.polymerType];
518
- if (!pt)
519
- pt = dict[libKey.polymerType] = {};
520
- pt[libKey.symbol] = value;
521
- }
522
- class MonomerMap extends Map {
523
- constructor(entries) {
524
- super(entries);
525
- }
526
- }
527
- /** @property monomers key - helm seq position, */
528
- class MolfileWithMap {
529
- constructor(molfile, monomers) {
530
- this.molfile = molfile;
531
- this.monomers = monomers;
532
- }
533
- static createEmpty() { return new MolfileWithMap('', new MonomerMap(null)); }
534
- }
535
- //# sourceMappingURL=types.js.map
536
-
537
- /***/ }),
538
-
539
- /***/ "./node_modules/@datagrok-libraries/bio/src/utils/const.js":
540
- /*!*****************************************************************!*\
541
- !*** ./node_modules/@datagrok-libraries/bio/src/utils/const.js ***!
542
- \*****************************************************************/
543
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
544
-
545
- __webpack_require__.r(__webpack_exports__);
546
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
547
- /* harmony export */ DEOXYRIBOSE_SYMBOL: () => (/* binding */ DEOXYRIBOSE_SYMBOL),
548
- /* harmony export */ DUMMY_MONOMER: () => (/* binding */ DUMMY_MONOMER),
549
- /* harmony export */ HELM_CORE_FIELDS: () => (/* binding */ HELM_CORE_FIELDS),
550
- /* harmony export */ HELM_WRAPPERS_REGEXP: () => (/* binding */ HELM_WRAPPERS_REGEXP),
551
- /* harmony export */ MONOMER_ENCODE_MAX: () => (/* binding */ MONOMER_ENCODE_MAX),
552
- /* harmony export */ MONOMER_ENCODE_MIN: () => (/* binding */ MONOMER_ENCODE_MIN),
553
- /* harmony export */ PHOSPHATE_SYMBOL: () => (/* binding */ PHOSPHATE_SYMBOL),
554
- /* harmony export */ RIBOSE_SYMBOL: () => (/* binding */ RIBOSE_SYMBOL),
555
- /* harmony export */ SDF_MONOMER_NAME: () => (/* binding */ SDF_MONOMER_NAME),
556
- /* harmony export */ jsonSdfMonomerLibDict: () => (/* binding */ jsonSdfMonomerLibDict)
557
- /* harmony export */ });
558
- // core fields of HELM library object used in toAtomicLevel function
559
- const HELM_CORE_FIELDS = [
560
- "symbol" /* HELM_FIELDS.SYMBOL */,
561
- "molfile" /* HELM_FIELDS.MOLFILE */,
562
- "rgroups" /* HELM_FIELDS.RGROUPS */,
563
- "name" /* HELM_FIELDS.NAME */,
564
- // HELM_FIELDS.MONOMER_TYPE, // add if terminal monomers for PEPTIDEs to be
565
- // supported
566
- ];
567
- const SDF_MONOMER_NAME = 'MonomerName';
568
- // todo: ideally, keys should be expressed via constants
569
- const jsonSdfMonomerLibDict = {
570
- 'monomerType': null, // -> Backbone
571
- 'smiles': null,
572
- 'name': 'Name',
573
- 'author': null,
574
- 'molfile': 'molecule',
575
- 'naturalAnalog': 'MonomerNaturalAnalogCode',
576
- 'rgroups': 'MonomerCaps',
577
- 'createDate': null,
578
- 'id': null,
579
- 'polymerType': 'MonomerType',
580
- 'symbol': 'MonomerName'
581
- };
582
- const DUMMY_MONOMER = {
583
- 'monomerType': 'Backbone',
584
- 'smiles': '',
585
- 'name': '',
586
- 'author': 'Datagrok',
587
- 'molfile': '',
588
- 'naturalAnalog': '',
589
- 'rgroups': [],
590
- 'createDate': null,
591
- 'id': 0,
592
- 'polymerType': 'PEPTIDE',
593
- 'symbol': ''
594
- };
595
- // range of hex nubers used in PepSea library to endode monomers
596
- const MONOMER_ENCODE_MIN = 0x100;
597
- const MONOMER_ENCODE_MAX = 0x40A;
598
- const RIBOSE_SYMBOL = 'r';
599
- const DEOXYRIBOSE_SYMBOL = 'd';
600
- const PHOSPHATE_SYMBOL = 'p';
601
- const HELM_WRAPPERS_REGEXP = new RegExp(`[${RIBOSE_SYMBOL}${DEOXYRIBOSE_SYMBOL}]\\((\\w)\\)${PHOSPHATE_SYMBOL}?`, 'g');
602
- //# sourceMappingURL=const.js.map
603
-
604
- /***/ }),
605
-
606
- /***/ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/consts.js":
607
- /*!********************************************************************************!*\
608
- !*** ./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/consts.js ***!
609
- \********************************************************************************/
610
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
611
-
612
- __webpack_require__.r(__webpack_exports__);
613
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
614
- /* harmony export */ ALPHABET: () => (/* binding */ ALPHABET),
615
- /* harmony export */ Alphabets: () => (/* binding */ Alphabets),
616
- /* harmony export */ BioTags: () => (/* binding */ TAGS),
617
- /* harmony export */ GAP_SYMBOL: () => (/* binding */ GAP_SYMBOL),
618
- /* harmony export */ GapOriginals: () => (/* binding */ GapOriginals),
619
- /* harmony export */ MONOMER_MOTIF_SPLITTER: () => (/* binding */ MONOMER_MOTIF_SPLITTER),
620
- /* harmony export */ NOTATION: () => (/* binding */ NOTATION),
621
- /* harmony export */ TAGS: () => (/* binding */ TAGS),
622
- /* harmony export */ candidateAlphabets: () => (/* binding */ candidateAlphabets),
623
- /* harmony export */ helmPp1Re: () => (/* binding */ helmPp1Re),
624
- /* harmony export */ helmRe: () => (/* binding */ helmRe),
625
- /* harmony export */ monomerRe: () => (/* binding */ monomerRe),
626
- /* harmony export */ positionSeparator: () => (/* binding */ positionSeparator)
627
- /* harmony export */ });
628
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/types.js");
629
-
630
- /** enum type to simplify setting "user-friendly" notation if necessary */
631
- var NOTATION;
632
- (function (NOTATION) {
633
- NOTATION["FASTA"] = "fasta";
634
- NOTATION["SEPARATOR"] = "separator";
635
- NOTATION["HELM"] = "helm";
636
- /* Requires notation handler */ NOTATION["CUSTOM"] = "custom";
637
- })(NOTATION || (NOTATION = {}));
638
- var ALPHABET;
639
- (function (ALPHABET) {
640
- ALPHABET["DNA"] = "DNA";
641
- ALPHABET["RNA"] = "RNA";
642
- ALPHABET["PT"] = "PT";
643
- /** Unknown */
644
- ALPHABET["UN"] = "UN";
645
- })(ALPHABET || (ALPHABET = {}));
646
- var TAGS;
647
- (function (TAGS) {
648
- TAGS["aligned"] = "aligned";
649
- TAGS["alphabet"] = "alphabet";
650
- TAGS["alphabetSize"] = ".alphabetSize";
651
- TAGS["alphabetIsMultichar"] = ".alphabetIsMultichar";
652
- TAGS["separator"] = "separator";
653
- TAGS["isHelmCompatible"] = ".isHelmCompatible";
654
- TAGS["positionNames"] = ".positionNames";
655
- TAGS["positionLabels"] = ".positionLabels";
656
- TAGS["regions"] = ".regions";
657
- TAGS["positionShift"] = ".positionShift";
658
- TAGS["selectedPosition"] = ".selectedPosition";
659
- })(TAGS || (TAGS = {}));
660
-
661
- const positionSeparator = ', ';
662
- const monomerRe = /(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g;
663
- const helmRe = /(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g;
664
- const helmPp1Re = /\[([^\[\]]+)]/g;
665
- const Alphabets = new class {
666
- constructor() {
667
- this.fasta = {
668
- peptide: new Set([
669
- 'G', 'L', 'Y', 'S', 'E', 'Q', 'D', 'N', 'F', 'A',
670
- 'K', 'R', 'H', 'C', 'V', 'P', 'W', 'I', 'M', 'T',
671
- ]),
672
- dna: new Set(['A', 'C', 'G', 'T']),
673
- rna: new Set(['A', 'C', 'G', 'U']),
674
- };
675
- }
676
- }();
677
- const candidateAlphabets = [
678
- new _types__WEBPACK_IMPORTED_MODULE_0__.CandidateType(ALPHABET.PT, Alphabets.fasta.peptide, 0.50),
679
- new _types__WEBPACK_IMPORTED_MODULE_0__.CandidateType(ALPHABET.DNA, Alphabets.fasta.dna, 0.55),
680
- new _types__WEBPACK_IMPORTED_MODULE_0__.CandidateType(ALPHABET.RNA, Alphabets.fasta.rna, 0.55),
681
- ];
682
- /** Canonical gap symbol */
683
- const GAP_SYMBOL = '';
684
- const GapOriginals = {
685
- [NOTATION.FASTA]: '-',
686
- [NOTATION.SEPARATOR]: '',
687
- [NOTATION.HELM]: '*',
688
- };
689
- const MONOMER_MOTIF_SPLITTER = ' , ';
690
- //# sourceMappingURL=consts.js.map
691
-
692
- /***/ }),
693
-
694
- /***/ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/types.js":
695
- /*!*******************************************************************************!*\
696
- !*** ./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/types.js ***!
697
- \*******************************************************************************/
698
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
699
-
700
- __webpack_require__.r(__webpack_exports__);
701
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
702
- /* harmony export */ CandidateSimType: () => (/* binding */ CandidateSimType),
703
- /* harmony export */ CandidateType: () => (/* binding */ CandidateType)
704
- /* harmony export */ });
705
- /** Alphabet candidate type */
706
- class CandidateType {
707
- constructor(name, alphabet, cutoff) {
708
- this.name = name;
709
- this.alphabet = alphabet;
710
- this.cutoff = cutoff;
711
- }
712
- }
713
- /** Alphabet candidate similarity type */
714
- class CandidateSimType extends CandidateType {
715
- constructor(candidate, freq, similarity) {
716
- super(candidate.name, candidate.alphabet, candidate.cutoff);
717
- this.freq = freq;
718
- this.similarity = similarity;
719
- }
720
- }
721
- //# sourceMappingURL=types.js.map
722
-
723
- /***/ }),
724
-
725
- /***/ "./node_modules/@datagrok-libraries/js-draw-lite/src/types/org.js":
726
- /*!************************************************************************!*\
727
- !*** ./node_modules/@datagrok-libraries/js-draw-lite/src/types/org.js ***!
728
- \************************************************************************/
729
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
730
-
731
- __webpack_require__.r(__webpack_exports__);
732
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
733
- /* harmony export */ HelmTypes: () => (/* binding */ HelmTypes)
734
- /* harmony export */ });
735
- var HelmTypes;
736
- (function (HelmTypes) {
737
- HelmTypes["BASE"] = "HELM_BASE";
738
- HelmTypes["SUGAR"] = "HELM_SUGAR";
739
- HelmTypes["LINKER"] = "HELM_LINKER";
740
- HelmTypes["AA"] = "HELM_AA";
741
- HelmTypes["CHEM"] = "HELM_CHEM";
742
- HelmTypes["BLOB"] = "HELM_BLOB";
743
- HelmTypes["NUCLEOTIDE"] = "HELM_NUCLETIDE";
744
- })(HelmTypes || (HelmTypes = {}));
745
- //# sourceMappingURL=org.js.map
746
-
747
- /***/ })
748
-
749
- /******/ });
750
- /************************************************************************/
751
- /******/ // The module cache
752
- /******/ var __webpack_module_cache__ = {};
753
- /******/
754
- /******/ // The require function
755
- /******/ function __webpack_require__(moduleId) {
756
- /******/ // Check if module is in cache
757
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
758
- /******/ if (cachedModule !== undefined) {
759
- /******/ return cachedModule.exports;
760
- /******/ }
761
- /******/ // Create a new module (and put it into the cache)
762
- /******/ var module = __webpack_module_cache__[moduleId] = {
763
- /******/ // no module.id needed
764
- /******/ // no module.loaded needed
765
- /******/ exports: {}
766
- /******/ };
767
- /******/
768
- /******/ // Execute the module function
769
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
770
- /******/
771
- /******/ // Return the exports of the module
772
- /******/ return module.exports;
773
- /******/ }
774
- /******/
775
- /************************************************************************/
776
- /******/ /* webpack/runtime/define property getters */
777
- /******/ (() => {
778
- /******/ // define getter functions for harmony exports
779
- /******/ __webpack_require__.d = (exports, definition) => {
780
- /******/ for(var key in definition) {
781
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
782
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
783
- /******/ }
784
- /******/ }
785
- /******/ };
786
- /******/ })();
787
- /******/
788
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
789
- /******/ (() => {
790
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
791
- /******/ })();
792
- /******/
793
- /******/ /* webpack/runtime/make namespace object */
794
- /******/ (() => {
795
- /******/ // define __esModule on exports
796
- /******/ __webpack_require__.r = (exports) => {
797
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
798
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
799
- /******/ }
800
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
801
- /******/ };
802
- /******/ })();
803
- /******/
804
- /************************************************************************/
805
- var __webpack_exports__ = {};
806
- /*!*****************************************************************************************!*\
807
- !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/seq-to-molfile-worker.js ***!
808
- \*****************************************************************************************/
809
- __webpack_require__.r(__webpack_exports__);
810
- /* harmony import */ var _to_atomic_level_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-atomic-level-utils */ "./node_modules/@datagrok-libraries/bio/src/monomer-works/to-atomic-level-utils.js");
811
-
812
- onmessage = (event) => {
813
- const { seqList, monomersDict, alphabet, polymerType, start, end } = event.data;
814
- const resMolList = new Array(end - start);
815
- const molfileWarningList = new Array(0);
816
- for (let rowI = start; rowI < end; ++rowI) {
817
- try {
818
- const seq = seqList[rowI];
819
- resMolList[rowI - start] = (0,_to_atomic_level_utils__WEBPACK_IMPORTED_MODULE_0__.monomerSeqToMolfile)(seq, monomersDict, alphabet, polymerType);
820
- }
821
- catch (err) {
822
- const errMsg = err instanceof Error ? err.message : err.toString();
823
- const msg = `Cannot get molfile of row #${rowI}: ${errMsg}.`;
824
- molfileWarningList.push(msg);
825
- }
826
- }
827
- postMessage({ molfiles: resMolList, warnings: molfileWarningList });
828
- };
829
- //# sourceMappingURL=seq-to-molfile-worker.js.map
830
- sequencetranslator = __webpack_exports__;
831
- /******/ })()
832
- ;
833
- //# sourceMappingURL=vendors-node_modules_datagrok-libraries_bio_src_monomer-works_seq-to-molfile-worker_js.js.map