@datagrok/sequence-translator 1.9.4 → 1.9.6

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.
@@ -0,0 +1,827 @@
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
+ for (v.i = 0; v.i < LC.seqLength; ++v.i) {
221
+ const seqMonomer = monomerSeq[v.i];
222
+ if (seqMonomer.symbol === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.GAP_SYMBOL)
223
+ continue;
224
+ const monomer = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, { symbol: seqMonomer.symbol, polymerType: (0,_monomer_works__WEBPACK_IMPORTED_MODULE_4__.helmTypeToPolymerType)(seqMonomer.biotype) });
225
+ const mAtomFirst = v.nodeShift;
226
+ const mBondFirst = v.bondShift;
227
+ addMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v, LC);
228
+ //adding stereo atoms to array for further STEABS block generation
229
+ monomer.stereoAtoms?.forEach((i) => steabsCollection.push(i + nAtoms));
230
+ nAtoms += monomer.atoms.x.length;
231
+ const mAtomCount = v.nodeShift - mAtomFirst;
232
+ const mAtomList = new Array(mAtomCount);
233
+ for (let maI = 0; maI < mAtomCount; ++maI)
234
+ mAtomList[maI] = mAtomFirst + maI;
235
+ const mBondCount = v.bondShift - mBondFirst;
236
+ const mBondList = new Array(mBondCount);
237
+ for (let mbI = 0; mbI < mBondCount; ++mbI)
238
+ mBondList[mbI] = mBondFirst + mbI;
239
+ monomers.set(v.i, {
240
+ biotype: seqMonomer.biotype,
241
+ symbol: seqMonomer.symbol,
242
+ atoms: mAtomList, bonds: mBondList
243
+ });
244
+ }
245
+ // if the last monomer needs to be capped, add the terminal OH to the resulting molfile
246
+ if (needsCapping)
247
+ capResultingMolblock(molfileAtomBlock, molfileBondBlock, v, LC);
248
+ const molfileCountsLine = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_COUNTS_LINE + atomCount + ' ' + bondCount + _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_COUNTS_LINE_ENDING;
249
+ // todo: possible optimization may be achieved by replacing .join('') with +=
250
+ // since counterintuitively joining an array into a new string is reportedly
251
+ // slower than using += as below
252
+ let result = '';
253
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_HEADER_FIRST_LINE;
254
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_HEADER_SECOND_LINE;
255
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_CTAB_BLOCK;
256
+ result += molfileCountsLine;
257
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_ATOM_BLOCK;
258
+ result += molfileAtomBlock.join('');
259
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END_ATOM_BLOCK;
260
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_BOND_BLOCK;
261
+ result += molfileBondBlock.join('');
262
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END_BOND_BLOCK;
263
+ if (steabsCollection.length > 0)
264
+ result += getCollectionBlock(steabsCollection);
265
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END_CTAB_BLOCK;
266
+ result += _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_END;
267
+ // return molfileParts.join('');
268
+ return { molfile: result, monomers: monomers };
269
+ }
270
+ function getCollectionBlock(collection) {
271
+ //one row in STEABS block can be no longer than 80 symbols
272
+ //maxSymbols = 80 symbols minus ' -\n' (4 symbols)
273
+ const maxSymbols = 76;
274
+ const rowsArray = [];
275
+ let newCollectionRow = `M V30 MDLV30/STEABS ATOMS=(${collection.length}`;
276
+ for (let i = 0; i < collection.length; i++) {
277
+ const updatedRow = `${newCollectionRow} ${collection[i]}`;
278
+ if (updatedRow.length > maxSymbols) {
279
+ rowsArray.push(`${newCollectionRow} -\n`);
280
+ newCollectionRow = `M V30 ${collection[i]}`;
281
+ }
282
+ else
283
+ newCollectionRow = updatedRow;
284
+ //in case last atom was added - close the block
285
+ if (i === collection.length - 1)
286
+ rowsArray.push(`${newCollectionRow})\n`);
287
+ }
288
+ return `M V30 BEGIN COLLECTION\n${rowsArray.join('')}M V30 END COLLECTION\n`;
289
+ }
290
+ /** Cap the resulting (after sewing up all the monomers) molfile with 'O'
291
+ * @param {string[]} molfileAtomBlock - Array of lines of the resulting molfile atom block
292
+ * @param {string[]} molfileBondBlock - Array of lines of the resulting molfile bond block
293
+ * @param {LoopVariables} v - Loop variables
294
+ * @param {LoopConstants} LC - Loop constants*/
295
+ function capResultingMolblock(molfileAtomBlock, molfileBondBlock, v, LC) {
296
+ // add terminal oxygen
297
+ const atomIdx = v.nodeShift + 1;
298
+ molfileAtomBlock[LC.atomCount] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + atomIdx + ' ' +
299
+ _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.OXYGEN + ' ' + keepPrecision(v.backbonePositionShift[0]) + ' ' +
300
+ v.flipFactor * keepPrecision(v.backbonePositionShift[1]) + ' ' + '0.000000 0' + '\n';
301
+ // add terminal bond
302
+ const firstAtom = v.backboneAttachNode;
303
+ const secondAtom = atomIdx;
304
+ molfileBondBlock[LC.bondCount] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + v.bondShift + ' ' +
305
+ 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
306
+ }
307
+ function addAminoAcidToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v) {
308
+ v.flipFactor = (-1) ** (v.i % 2); // to flip every even monomer over OX
309
+ addBackboneMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v);
310
+ }
311
+ function addBackboneMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v) {
312
+ // todo: remove these comments to the docstrings of the corr. functions
313
+ // construnct the lines of V3K molfile atom block
314
+ fillAtomLines(monomer, molfileAtomBlock, v);
315
+ // construct the lines of V3K molfile bond block
316
+ fillBondLines(monomer, molfileBondBlock, v);
317
+ // peptide bond
318
+ fillChainExtendingBond(monomer, molfileBondBlock, v);
319
+ // update branch variables if necessary
320
+ if (monomer.meta.branchShift !== null && monomer.meta.terminalNodes.length > 2)
321
+ updateBranchVariables(monomer, v);
322
+ // update loop variables
323
+ updateChainExtendingVariables(monomer, v);
324
+ }
325
+ function addNucleotideToMolblock(nucleobase, molfileAtomBlock, molfileBondBlock, v, LC) {
326
+ // construnct the lines of V3K molfile atom block corresponding to phosphate
327
+ // and sugar
328
+ if (v.i === 0)
329
+ addBackboneMonomerToMolblock(LC.sugar, molfileAtomBlock, molfileBondBlock, v);
330
+ else {
331
+ for (const monomer of [LC.phosphate, LC.sugar])
332
+ addBackboneMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v);
333
+ }
334
+ addBranchMonomerToMolblock(nucleobase, molfileAtomBlock, molfileBondBlock, v);
335
+ }
336
+ function addBranchMonomerToMolblock(monomer, molfileAtomBlock, molfileBondBlock, v) {
337
+ fillBranchAtomLines(monomer, molfileAtomBlock, v);
338
+ fillBondLines(monomer, molfileBondBlock, v);
339
+ fillBackboneToBranchBond(monomer, molfileBondBlock, v);
340
+ // C-N bond
341
+ const bondIdx = v.bondShift;
342
+ const firstAtom = v.branchAttachNode;
343
+ const secondAtom = monomer.meta.terminalNodes[0] + v.nodeShift;
344
+ molfileBondBlock[bondIdx - 1] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
345
+ 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
346
+ // update loop variables
347
+ v.bondShift += monomer.bonds.atomPairs.length + 1;
348
+ v.nodeShift += monomer.atoms.atomTypes.length;
349
+ }
350
+ function updateChainExtendingVariables(monomer, v) {
351
+ v.backboneAttachNode = v.nodeShift + monomer.meta.terminalNodes[1];
352
+ v.bondShift += monomer.bonds.atomPairs.length + 1;
353
+ v.nodeShift += monomer.atoms.atomTypes.length;
354
+ v.backbonePositionShift[0] += monomer.meta.backboneShift?.[0] ?? 0; // todo: non-null check
355
+ v.backbonePositionShift[1] += v.flipFactor * (monomer.meta.backboneShift?.[1] ?? 0);
356
+ }
357
+ function updateBranchVariables(monomer, v) {
358
+ v.branchAttachNode = v.nodeShift + monomer.meta.terminalNodes[2];
359
+ for (let i = 0; i < 2; ++i)
360
+ v.branchPositionShift[i] = v.backbonePositionShift[i] + monomer.meta.branchShift[i];
361
+ }
362
+ function fillAtomLines(monomer, molfileAtomBlock, v) {
363
+ for (let j = 0; j < monomer.atoms.atomTypes.length; ++j) {
364
+ const atomIdx = v.nodeShift + j + 1;
365
+ molfileAtomBlock[v.nodeShift + j] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + atomIdx + ' ' +
366
+ monomer.atoms.atomTypes[j] + ' ' +
367
+ keepPrecision(v.backbonePositionShift[0] + monomer.atoms.x[j]) + ' ' +
368
+ keepPrecision(v.backbonePositionShift[1] + v.flipFactor * monomer.atoms.y[j]) +
369
+ ' ' + monomer.atoms.kwargs[j];
370
+ }
371
+ }
372
+ // todo: remove as quickfix
373
+ function fillBranchAtomLines(monomer, molfileAtomBlock, v) {
374
+ for (let j = 0; j < monomer.atoms.atomTypes.length; ++j) {
375
+ const atomIdx = v.nodeShift + j + 1;
376
+ molfileAtomBlock[v.nodeShift + j] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + atomIdx + ' ' +
377
+ monomer.atoms.atomTypes[j] + ' ' +
378
+ keepPrecision(v.branchPositionShift[0] + monomer.atoms.x[j]) + ' ' +
379
+ keepPrecision(v.branchPositionShift[1] + v.flipFactor * monomer.atoms.y[j]) +
380
+ ' ' + monomer.atoms.kwargs[j];
381
+ }
382
+ }
383
+ function fillBondLines(monomer, molfileBondBlock, v) {
384
+ // construct the lines of V3K molfile bond block
385
+ for (let j = 0; j < monomer.bonds.atomPairs.length; ++j) {
386
+ const bondIdx = v.bondShift + j + 1;
387
+ const firstAtom = monomer.bonds.atomPairs[j][0] + v.nodeShift;
388
+ const secondAtom = monomer.bonds.atomPairs[j][1] + v.nodeShift;
389
+ let bondCfg = '';
390
+ if (monomer.bonds.bondConfiguration.has(j)) {
391
+ // flip orientation when necessary
392
+ let orientation = monomer.bonds.bondConfiguration.get(j);
393
+ if (v.flipFactor < 0)
394
+ orientation = (orientation === 1) ? 3 : 1;
395
+ bondCfg = ' CFG=' + orientation;
396
+ }
397
+ const kwargs = monomer.bonds.kwargs.has(j) ?
398
+ ' ' + monomer.bonds.kwargs.get(j) : '';
399
+ molfileBondBlock[v.bondShift + j] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
400
+ monomer.bonds.bondTypes[j] + ' ' +
401
+ firstAtom + ' ' + secondAtom + bondCfg + kwargs + '\n';
402
+ }
403
+ }
404
+ function fillChainExtendingBond(monomer, molfileBondBlock, v) {
405
+ if (v.backboneAttachNode !== 0) {
406
+ const bondIdx = v.bondShift;
407
+ const firstAtom = v.backboneAttachNode;
408
+ const secondAtom = monomer.meta.terminalNodes[0] + v.nodeShift;
409
+ molfileBondBlock[v.bondShift - 1] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
410
+ 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
411
+ }
412
+ }
413
+ // todo: remove
414
+ function fillBackboneToBranchBond(branchMonomer, molfileBondBlock, v) {
415
+ const bondIdx = v.bondShift;
416
+ const firstAtom = v.branchAttachNode;
417
+ const secondAtom = branchMonomer.meta.terminalNodes[0] + v.nodeShift;
418
+ molfileBondBlock[bondIdx - 1] = _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.V3K_BEGIN_DATA_LINE + bondIdx + ' ' +
419
+ 1 + ' ' + firstAtom + ' ' + secondAtom + '\n';
420
+ }
421
+ /** Compute the atom/bond counts for the resulting molfile, depending on the
422
+ * type of polymer (peptide/nucleotide)
423
+ * @param {string[]}monomerSeq - the sequence of monomers
424
+ * @param {Map<string, MolGraph>}monomersDict - the dictionary of monomers
425
+ * @param {ALPHABET}alphabet - the alphabet of the monomers
426
+ * @param {HELM_POLYMER_TYPE}polymerType - the type of polymer
427
+ * @return {{atomCount: number, bondCount: number}} - the atom/bond counts*/
428
+ function getResultingAtomBondCounts(monomerSeq, monomersDict, alphabet, polymerType) {
429
+ let atomCount = 0;
430
+ let bondCount = 0;
431
+ let monomerCount = 0;
432
+ let needsCapping = true;
433
+ let lastMonomerGraph = null;
434
+ // sum up all the atoms/nodes provided by the sequence
435
+ for (const seqMonomer of monomerSeq) {
436
+ if (seqMonomer.symbol === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.GAP_SYMBOL)
437
+ continue; // Skip for gap/empty monomer in MSA
438
+ if (seqMonomer.symbol == '*')
439
+ throw new Error(`Gap canonical symbol is '', not '*`);
440
+ lastMonomerGraph = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, { symbol: seqMonomer.symbol, polymerType: (0,_monomer_works__WEBPACK_IMPORTED_MODULE_4__.helmTypeToPolymerType)(seqMonomer.biotype) });
441
+ atomCount += lastMonomerGraph.atoms.x.length;
442
+ bondCount += lastMonomerGraph.bonds.bondTypes.length;
443
+ monomerCount++;
444
+ }
445
+ // add extra values depending on the polymer type
446
+ if (polymerType === "PEPTIDE" /* HELM_POLYMER_TYPE.PEPTIDE */) {
447
+ // add the rightmost/terminating cap group 'OH' (i.e. 'O')
448
+ atomCount += 1;
449
+ // add chain-extending bonds (C-NH per each monomer pair and terminal C-OH)
450
+ bondCount += monomerCount;
451
+ // if the last monomer is something like NH2, which only has R1, there is no need to cap it
452
+ if (monomerCount > 0) {
453
+ if ((lastMonomerGraph?.meta?.rNodes?.length ?? 0) < 2) {
454
+ needsCapping = false;
455
+ atomCount -= 1; // remove the last atom (the terminal 'O')
456
+ bondCount -= 1; // remove the last bond (the terminal C-OH)
457
+ }
458
+ }
459
+ }
460
+ else { // nucleotides
461
+ const sugar = (alphabet === _utils_macromolecule_consts__WEBPACK_IMPORTED_MODULE_3__.ALPHABET.DNA) ?
462
+ (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);
463
+ const phosphate = (0,_types__WEBPACK_IMPORTED_MODULE_1__.getMolGraph)(monomersDict, _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PHOSPHATE);
464
+ // add phosphate per each pair of nucleobase symbols
465
+ atomCount += (monomerSeq.length - 1) * phosphate.atoms.x.length;
466
+ // add sugar per each nucleobase symbol
467
+ atomCount += monomerSeq.length * sugar.atoms.x.length;
468
+ // add the leftmost cap group 'OH' (i.e. 'O')
469
+ atomCount += 1;
470
+ // add bonds from phosphate monomers
471
+ bondCount += (monomerSeq.length - 1) * phosphate.bonds.bondTypes.length;
472
+ // add bonds from sugar monomers
473
+ bondCount += monomerSeq.length * sugar.bonds.bondTypes.length;
474
+ // exclude the first chain-extending bond O-P (absent, no 'leftmost' phosphate)
475
+ bondCount -= 1;
476
+ // add chain-extending and branch bonds (O-P, C-O and C-N per each nucleotide)
477
+ bondCount += monomerSeq.length * 3;
478
+ }
479
+ return { atomCount, bondCount, needsCapping };
480
+ }
481
+ /** Keep precision upon floating point operations over atom coordinates
482
+ * @param {number}x - the floating point number
483
+ * @return {number} - the floating point number with the same precision
484
+ */
485
+ function keepPrecision(x) {
486
+ return Math.round(_consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PRECISION_FACTOR * x) / _consts__WEBPACK_IMPORTED_MODULE_0__.monomerWorksConsts.PRECISION_FACTOR;
487
+ }
488
+ //# sourceMappingURL=to-atomic-level-utils.js.map
489
+
490
+ /***/ }),
491
+
492
+ /***/ "./node_modules/@datagrok-libraries/bio/src/monomer-works/types.js":
493
+ /*!*************************************************************************!*\
494
+ !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/types.js ***!
495
+ \*************************************************************************/
496
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
497
+
498
+ __webpack_require__.r(__webpack_exports__);
499
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
500
+ /* harmony export */ MolfileWithMap: () => (/* binding */ MolfileWithMap),
501
+ /* harmony export */ MonomerMap: () => (/* binding */ MonomerMap),
502
+ /* harmony export */ getMolGraph: () => (/* binding */ getMolGraph),
503
+ /* harmony export */ hasMolGraph: () => (/* binding */ hasMolGraph),
504
+ /* harmony export */ setMolGraph: () => (/* binding */ setMolGraph)
505
+ /* harmony export */ });
506
+ function getMolGraph(dict, libKey) {
507
+ return dict[libKey.polymerType]?.[libKey.symbol];
508
+ }
509
+ function hasMolGraph(dict, libKey) {
510
+ return !!dict[libKey.polymerType]?.[libKey.symbol];
511
+ }
512
+ function setMolGraph(dict, libKey, value) {
513
+ let pt = dict[libKey.polymerType];
514
+ if (!pt)
515
+ pt = dict[libKey.polymerType] = {};
516
+ pt[libKey.symbol] = value;
517
+ }
518
+ class MonomerMap extends Map {
519
+ constructor(entries) {
520
+ super(entries);
521
+ }
522
+ }
523
+ /** @property monomers key - helm seq position, */
524
+ class MolfileWithMap {
525
+ constructor(molfile, monomers) {
526
+ this.molfile = molfile;
527
+ this.monomers = monomers;
528
+ }
529
+ static createEmpty() { return new MolfileWithMap('', new MonomerMap(null)); }
530
+ }
531
+ //# sourceMappingURL=types.js.map
532
+
533
+ /***/ }),
534
+
535
+ /***/ "./node_modules/@datagrok-libraries/bio/src/utils/const.js":
536
+ /*!*****************************************************************!*\
537
+ !*** ./node_modules/@datagrok-libraries/bio/src/utils/const.js ***!
538
+ \*****************************************************************/
539
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
540
+
541
+ __webpack_require__.r(__webpack_exports__);
542
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
543
+ /* harmony export */ DEOXYRIBOSE_SYMBOL: () => (/* binding */ DEOXYRIBOSE_SYMBOL),
544
+ /* harmony export */ DUMMY_MONOMER: () => (/* binding */ DUMMY_MONOMER),
545
+ /* harmony export */ HELM_CORE_FIELDS: () => (/* binding */ HELM_CORE_FIELDS),
546
+ /* harmony export */ HELM_WRAPPERS_REGEXP: () => (/* binding */ HELM_WRAPPERS_REGEXP),
547
+ /* harmony export */ MONOMER_ENCODE_MAX: () => (/* binding */ MONOMER_ENCODE_MAX),
548
+ /* harmony export */ MONOMER_ENCODE_MIN: () => (/* binding */ MONOMER_ENCODE_MIN),
549
+ /* harmony export */ PHOSPHATE_SYMBOL: () => (/* binding */ PHOSPHATE_SYMBOL),
550
+ /* harmony export */ RIBOSE_SYMBOL: () => (/* binding */ RIBOSE_SYMBOL),
551
+ /* harmony export */ SDF_MONOMER_NAME: () => (/* binding */ SDF_MONOMER_NAME),
552
+ /* harmony export */ jsonSdfMonomerLibDict: () => (/* binding */ jsonSdfMonomerLibDict)
553
+ /* harmony export */ });
554
+ // core fields of HELM library object used in toAtomicLevel function
555
+ const HELM_CORE_FIELDS = [
556
+ "symbol" /* HELM_FIELDS.SYMBOL */,
557
+ "molfile" /* HELM_FIELDS.MOLFILE */,
558
+ "rgroups" /* HELM_FIELDS.RGROUPS */,
559
+ "name" /* HELM_FIELDS.NAME */,
560
+ // HELM_FIELDS.MONOMER_TYPE, // add if terminal monomers for PEPTIDEs to be
561
+ // supported
562
+ ];
563
+ const SDF_MONOMER_NAME = 'MonomerName';
564
+ // todo: ideally, keys should be expressed via constants
565
+ const jsonSdfMonomerLibDict = {
566
+ 'monomerType': null, // -> Backbone
567
+ 'smiles': null,
568
+ 'name': 'Name',
569
+ 'author': null,
570
+ 'molfile': 'molecule',
571
+ 'naturalAnalog': 'MonomerNaturalAnalogCode',
572
+ 'rgroups': 'MonomerCaps',
573
+ 'createDate': null,
574
+ 'id': null,
575
+ 'polymerType': 'MonomerType',
576
+ 'symbol': 'MonomerName'
577
+ };
578
+ const DUMMY_MONOMER = {
579
+ 'monomerType': 'Backbone',
580
+ 'smiles': '',
581
+ 'name': '',
582
+ 'author': 'Datagrok',
583
+ 'molfile': '',
584
+ 'naturalAnalog': '',
585
+ 'rgroups': [],
586
+ 'createDate': null,
587
+ 'id': 0,
588
+ 'polymerType': 'PEPTIDE',
589
+ 'symbol': ''
590
+ };
591
+ // range of hex nubers used in PepSea library to endode monomers
592
+ const MONOMER_ENCODE_MIN = 0x100;
593
+ const MONOMER_ENCODE_MAX = 0x40A;
594
+ const RIBOSE_SYMBOL = 'r';
595
+ const DEOXYRIBOSE_SYMBOL = 'd';
596
+ const PHOSPHATE_SYMBOL = 'p';
597
+ const HELM_WRAPPERS_REGEXP = new RegExp(`[${RIBOSE_SYMBOL}${DEOXYRIBOSE_SYMBOL}]\\((\\w)\\)${PHOSPHATE_SYMBOL}?`, 'g');
598
+ //# sourceMappingURL=const.js.map
599
+
600
+ /***/ }),
601
+
602
+ /***/ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/consts.js":
603
+ /*!********************************************************************************!*\
604
+ !*** ./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/consts.js ***!
605
+ \********************************************************************************/
606
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
607
+
608
+ __webpack_require__.r(__webpack_exports__);
609
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
610
+ /* harmony export */ ALPHABET: () => (/* binding */ ALPHABET),
611
+ /* harmony export */ Alphabets: () => (/* binding */ Alphabets),
612
+ /* harmony export */ BioTags: () => (/* binding */ TAGS),
613
+ /* harmony export */ GAP_SYMBOL: () => (/* binding */ GAP_SYMBOL),
614
+ /* harmony export */ GapOriginals: () => (/* binding */ GapOriginals),
615
+ /* harmony export */ NOTATION: () => (/* binding */ NOTATION),
616
+ /* harmony export */ TAGS: () => (/* binding */ TAGS),
617
+ /* harmony export */ candidateAlphabets: () => (/* binding */ candidateAlphabets),
618
+ /* harmony export */ helmPp1Re: () => (/* binding */ helmPp1Re),
619
+ /* harmony export */ helmRe: () => (/* binding */ helmRe),
620
+ /* harmony export */ monomerRe: () => (/* binding */ monomerRe),
621
+ /* harmony export */ positionSeparator: () => (/* binding */ positionSeparator)
622
+ /* harmony export */ });
623
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/types.js");
624
+
625
+ /** enum type to simplify setting "user-friendly" notation if necessary */
626
+ var NOTATION;
627
+ (function (NOTATION) {
628
+ NOTATION["FASTA"] = "fasta";
629
+ NOTATION["SEPARATOR"] = "separator";
630
+ NOTATION["HELM"] = "helm";
631
+ /* Requires notation handler */ NOTATION["CUSTOM"] = "custom";
632
+ })(NOTATION || (NOTATION = {}));
633
+ var ALPHABET;
634
+ (function (ALPHABET) {
635
+ ALPHABET["DNA"] = "DNA";
636
+ ALPHABET["RNA"] = "RNA";
637
+ ALPHABET["PT"] = "PT";
638
+ /** Unknown */
639
+ ALPHABET["UN"] = "UN";
640
+ })(ALPHABET || (ALPHABET = {}));
641
+ var TAGS;
642
+ (function (TAGS) {
643
+ TAGS["aligned"] = "aligned";
644
+ TAGS["alphabet"] = "alphabet";
645
+ TAGS["alphabetSize"] = ".alphabetSize";
646
+ TAGS["alphabetIsMultichar"] = ".alphabetIsMultichar";
647
+ TAGS["separator"] = "separator";
648
+ TAGS["isHelmCompatible"] = ".isHelmCompatible";
649
+ TAGS["positionNames"] = ".positionNames";
650
+ TAGS["positionLabels"] = ".positionLabels";
651
+ TAGS["regions"] = ".regions";
652
+ TAGS["positionShift"] = ".positionShift";
653
+ TAGS["selectedPosition"] = ".selectedPosition";
654
+ })(TAGS || (TAGS = {}));
655
+
656
+ const positionSeparator = ', ';
657
+ const monomerRe = /(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g;
658
+ const helmRe = /(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g;
659
+ const helmPp1Re = /\[([^\[\]]+)]/g;
660
+ const Alphabets = new class {
661
+ constructor() {
662
+ this.fasta = {
663
+ peptide: new Set([
664
+ 'G', 'L', 'Y', 'S', 'E', 'Q', 'D', 'N', 'F', 'A',
665
+ 'K', 'R', 'H', 'C', 'V', 'P', 'W', 'I', 'M', 'T',
666
+ ]),
667
+ dna: new Set(['A', 'C', 'G', 'T']),
668
+ rna: new Set(['A', 'C', 'G', 'U']),
669
+ };
670
+ }
671
+ }();
672
+ const candidateAlphabets = [
673
+ new _types__WEBPACK_IMPORTED_MODULE_0__.CandidateType(ALPHABET.PT, Alphabets.fasta.peptide, 0.50),
674
+ new _types__WEBPACK_IMPORTED_MODULE_0__.CandidateType(ALPHABET.DNA, Alphabets.fasta.dna, 0.55),
675
+ new _types__WEBPACK_IMPORTED_MODULE_0__.CandidateType(ALPHABET.RNA, Alphabets.fasta.rna, 0.55),
676
+ ];
677
+ /** Canonical gap symbol */
678
+ const GAP_SYMBOL = '';
679
+ const GapOriginals = {
680
+ [NOTATION.FASTA]: '-',
681
+ [NOTATION.SEPARATOR]: '',
682
+ [NOTATION.HELM]: '*',
683
+ };
684
+ //# sourceMappingURL=consts.js.map
685
+
686
+ /***/ }),
687
+
688
+ /***/ "./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/types.js":
689
+ /*!*******************************************************************************!*\
690
+ !*** ./node_modules/@datagrok-libraries/bio/src/utils/macromolecule/types.js ***!
691
+ \*******************************************************************************/
692
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
693
+
694
+ __webpack_require__.r(__webpack_exports__);
695
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
696
+ /* harmony export */ CandidateSimType: () => (/* binding */ CandidateSimType),
697
+ /* harmony export */ CandidateType: () => (/* binding */ CandidateType)
698
+ /* harmony export */ });
699
+ /** Alphabet candidate type */
700
+ class CandidateType {
701
+ constructor(name, alphabet, cutoff) {
702
+ this.name = name;
703
+ this.alphabet = alphabet;
704
+ this.cutoff = cutoff;
705
+ }
706
+ }
707
+ /** Alphabet candidate similarity type */
708
+ class CandidateSimType extends CandidateType {
709
+ constructor(candidate, freq, similarity) {
710
+ super(candidate.name, candidate.alphabet, candidate.cutoff);
711
+ this.freq = freq;
712
+ this.similarity = similarity;
713
+ }
714
+ }
715
+ //# sourceMappingURL=types.js.map
716
+
717
+ /***/ }),
718
+
719
+ /***/ "./node_modules/@datagrok-libraries/js-draw-lite/src/types/org.js":
720
+ /*!************************************************************************!*\
721
+ !*** ./node_modules/@datagrok-libraries/js-draw-lite/src/types/org.js ***!
722
+ \************************************************************************/
723
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
724
+
725
+ __webpack_require__.r(__webpack_exports__);
726
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
727
+ /* harmony export */ HelmTypes: () => (/* binding */ HelmTypes)
728
+ /* harmony export */ });
729
+ var HelmTypes;
730
+ (function (HelmTypes) {
731
+ HelmTypes["BASE"] = "HELM_BASE";
732
+ HelmTypes["SUGAR"] = "HELM_SUGAR";
733
+ HelmTypes["LINKER"] = "HELM_LINKER";
734
+ HelmTypes["AA"] = "HELM_AA";
735
+ HelmTypes["CHEM"] = "HELM_CHEM";
736
+ HelmTypes["BLOB"] = "HELM_BLOB";
737
+ HelmTypes["NUCLEOTIDE"] = "HELM_NUCLETIDE";
738
+ })(HelmTypes || (HelmTypes = {}));
739
+ //# sourceMappingURL=org.js.map
740
+
741
+ /***/ })
742
+
743
+ /******/ });
744
+ /************************************************************************/
745
+ /******/ // The module cache
746
+ /******/ var __webpack_module_cache__ = {};
747
+ /******/
748
+ /******/ // The require function
749
+ /******/ function __webpack_require__(moduleId) {
750
+ /******/ // Check if module is in cache
751
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
752
+ /******/ if (cachedModule !== undefined) {
753
+ /******/ return cachedModule.exports;
754
+ /******/ }
755
+ /******/ // Create a new module (and put it into the cache)
756
+ /******/ var module = __webpack_module_cache__[moduleId] = {
757
+ /******/ // no module.id needed
758
+ /******/ // no module.loaded needed
759
+ /******/ exports: {}
760
+ /******/ };
761
+ /******/
762
+ /******/ // Execute the module function
763
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
764
+ /******/
765
+ /******/ // Return the exports of the module
766
+ /******/ return module.exports;
767
+ /******/ }
768
+ /******/
769
+ /************************************************************************/
770
+ /******/ /* webpack/runtime/define property getters */
771
+ /******/ (() => {
772
+ /******/ // define getter functions for harmony exports
773
+ /******/ __webpack_require__.d = (exports, definition) => {
774
+ /******/ for(var key in definition) {
775
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
776
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
777
+ /******/ }
778
+ /******/ }
779
+ /******/ };
780
+ /******/ })();
781
+ /******/
782
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
783
+ /******/ (() => {
784
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
785
+ /******/ })();
786
+ /******/
787
+ /******/ /* webpack/runtime/make namespace object */
788
+ /******/ (() => {
789
+ /******/ // define __esModule on exports
790
+ /******/ __webpack_require__.r = (exports) => {
791
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
792
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
793
+ /******/ }
794
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
795
+ /******/ };
796
+ /******/ })();
797
+ /******/
798
+ /************************************************************************/
799
+ var __webpack_exports__ = {};
800
+ /*!*****************************************************************************************!*\
801
+ !*** ./node_modules/@datagrok-libraries/bio/src/monomer-works/seq-to-molfile-worker.js ***!
802
+ \*****************************************************************************************/
803
+ __webpack_require__.r(__webpack_exports__);
804
+ /* 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");
805
+
806
+ onmessage = (event) => {
807
+ const { seqList, monomersDict, alphabet, polymerType, start, end } = event.data;
808
+ const resMolList = new Array(end - start);
809
+ const molfileWarningList = new Array(0);
810
+ for (let rowI = start; rowI < end; ++rowI) {
811
+ try {
812
+ const seq = seqList[rowI];
813
+ resMolList[rowI - start] = (0,_to_atomic_level_utils__WEBPACK_IMPORTED_MODULE_0__.monomerSeqToMolfile)(seq, monomersDict, alphabet, polymerType);
814
+ }
815
+ catch (err) {
816
+ const errMsg = err instanceof Error ? err.message : err.toString();
817
+ const msg = `Cannot get molfile of row #${rowI}: ${errMsg}.`;
818
+ molfileWarningList.push(msg);
819
+ }
820
+ }
821
+ postMessage({ molfiles: resMolList, warnings: molfileWarningList });
822
+ };
823
+ //# sourceMappingURL=seq-to-molfile-worker.js.map
824
+ sequencetranslator = __webpack_exports__;
825
+ /******/ })()
826
+ ;
827
+ //# sourceMappingURL=vendors-node_modules_datagrok-libraries_bio_src_monomer-works_seq-to-molfile-worker_js.js.map