@datagrok/proteomics 1.0.0
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/.eslintignore +1 -0
- package/.eslintrc.json +56 -0
- package/CHANGELOG.md +3 -0
- package/LICENSE +674 -0
- package/README.md +3 -0
- package/detectors.js +9 -0
- package/dist/package-test.js +1745 -0
- package/dist/package-test.js.map +1 -0
- package/dist/package.js +147 -0
- package/dist/package.js.map +1 -0
- package/package.json +62 -0
- package/package.png +0 -0
- package/scripts/number_antibody.py +190 -0
- package/scripts/number_antibody_abnumber.py +177 -0
- package/scripts/number_antibody_anarci.py +200 -0
- package/src/package-api.ts +37 -0
- package/src/package-test.ts +20 -0
- package/src/package.g.ts +1 -0
- package/src/package.ts +17 -0
- package/tsconfig.json +71 -0
- package/webpack.config.js +45 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#name: Number Antibody Sequences (ANARCI)
|
|
2
|
+
#description: [Legacy] Assigns antibody numbering (IMGT/Kabat/Chothia/AHo) using ANARCI directly
|
|
3
|
+
#language: python
|
|
4
|
+
#environment: channels: [conda-forge, bioconda, defaults], dependencies: [python=3.9, pip, hmmer=3.3.2, anarci]
|
|
5
|
+
#input: dataframe df
|
|
6
|
+
#input: column seqCol {semType: Macromolecule}
|
|
7
|
+
#input: string scheme {choices: ["imgt", "kabat", "chothia", "aho"]} [Numbering scheme]
|
|
8
|
+
#output: dataframe result
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import pandas as pd
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
from anarci import anarci, number
|
|
15
|
+
except ImportError:
|
|
16
|
+
raise ImportError(
|
|
17
|
+
'ANARCI is not installed. Please install it with:\n'
|
|
18
|
+
' conda install -c bioconda anarci hmmer\n'
|
|
19
|
+
'or:\n'
|
|
20
|
+
' pip install anarci\n'
|
|
21
|
+
'HMMER must also be available on PATH.'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# IMGT region boundaries (used for all schemes after numbering)
|
|
25
|
+
IMGT_REGIONS = {
|
|
26
|
+
'Heavy': [
|
|
27
|
+
('FR1', 1, 26), ('CDR1', 27, 38), ('FR2', 39, 55),
|
|
28
|
+
('CDR2', 56, 65), ('FR3', 66, 104), ('CDR3', 105, 117), ('FR4', 118, 128),
|
|
29
|
+
],
|
|
30
|
+
'Light': [
|
|
31
|
+
('FR1', 1, 26), ('CDR1', 27, 38), ('FR2', 39, 55),
|
|
32
|
+
('CDR2', 56, 65), ('FR3', 66, 104), ('CDR3', 105, 117), ('FR4', 118, 127),
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
KABAT_REGIONS = {
|
|
37
|
+
'Heavy': [
|
|
38
|
+
('FR1', 1, 30), ('CDR1', 31, 35), ('FR2', 36, 49),
|
|
39
|
+
('CDR2', 50, 65), ('FR3', 66, 94), ('CDR3', 95, 102), ('FR4', 103, 113),
|
|
40
|
+
],
|
|
41
|
+
'Light': [
|
|
42
|
+
('FR1', 1, 23), ('CDR1', 24, 34), ('FR2', 35, 49),
|
|
43
|
+
('CDR2', 50, 56), ('FR3', 57, 88), ('CDR3', 89, 97), ('FR4', 98, 107),
|
|
44
|
+
],
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
CHOTHIA_REGIONS = {
|
|
48
|
+
'Heavy': [
|
|
49
|
+
('FR1', 1, 25), ('CDR1', 26, 32), ('FR2', 33, 51),
|
|
50
|
+
('CDR2', 52, 56), ('FR3', 57, 94), ('CDR3', 95, 102), ('FR4', 103, 113),
|
|
51
|
+
],
|
|
52
|
+
'Light': [
|
|
53
|
+
('FR1', 1, 25), ('CDR1', 26, 32), ('FR2', 33, 49),
|
|
54
|
+
('CDR2', 50, 52), ('FR3', 53, 90), ('CDR3', 91, 96), ('FR4', 97, 107),
|
|
55
|
+
],
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
AHO_REGIONS = {
|
|
59
|
+
'Heavy': [
|
|
60
|
+
('FR1', 1, 24), ('CDR1', 25, 40), ('FR2', 41, 55),
|
|
61
|
+
('CDR2', 56, 78), ('FR3', 79, 108), ('CDR3', 109, 138), ('FR4', 139, 149),
|
|
62
|
+
],
|
|
63
|
+
'Light': [
|
|
64
|
+
('FR1', 1, 24), ('CDR1', 25, 40), ('FR2', 41, 55),
|
|
65
|
+
('CDR2', 56, 78), ('FR3', 79, 108), ('CDR3', 109, 138), ('FR4', 139, 149),
|
|
66
|
+
],
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
SCHEME_REGIONS = {
|
|
70
|
+
'imgt': IMGT_REGIONS,
|
|
71
|
+
'kabat': KABAT_REGIONS,
|
|
72
|
+
'chothia': CHOTHIA_REGIONS,
|
|
73
|
+
'aho': AHO_REGIONS,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def extract_sequence(raw_seq):
|
|
78
|
+
"""Extract single-letter amino acid sequence from various formats."""
|
|
79
|
+
if not raw_seq or not isinstance(raw_seq, str):
|
|
80
|
+
return ''
|
|
81
|
+
s = raw_seq.strip()
|
|
82
|
+
# If it looks like FASTA single-letter (only AA chars and gaps)
|
|
83
|
+
s = s.replace('-', '').replace('.', '')
|
|
84
|
+
# Filter to valid amino acid characters
|
|
85
|
+
valid = set('ACDEFGHIKLMNPQRSTVWY')
|
|
86
|
+
return ''.join(c for c in s.upper() if c in valid)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def number_sequences(sequences, scheme_name):
|
|
90
|
+
"""Number a list of sequences using ANARCI."""
|
|
91
|
+
# Prepare input for ANARCI
|
|
92
|
+
seq_list = [(f'seq_{i}', seq) for i, seq in enumerate(sequences) if seq]
|
|
93
|
+
|
|
94
|
+
if not seq_list:
|
|
95
|
+
return [], [], []
|
|
96
|
+
|
|
97
|
+
# Run ANARCI
|
|
98
|
+
numbered_seqs, alignment_details, hit_tables = anarci(
|
|
99
|
+
seq_list,
|
|
100
|
+
scheme=scheme_name,
|
|
101
|
+
output=False,
|
|
102
|
+
allow=set(['H', 'K', 'L']),
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return numbered_seqs, alignment_details, hit_tables
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# Extract sequences from the input column
|
|
109
|
+
col_name = seqCol
|
|
110
|
+
sequences = []
|
|
111
|
+
for i in range(df.shape[0]):
|
|
112
|
+
raw = df[col_name].iloc[i]
|
|
113
|
+
sequences.append(extract_sequence(str(raw) if raw is not None else ''))
|
|
114
|
+
|
|
115
|
+
# Number all sequences
|
|
116
|
+
numbered_seqs, alignment_details, hit_tables = number_sequences(sequences, scheme)
|
|
117
|
+
|
|
118
|
+
# Process results
|
|
119
|
+
position_names_list = []
|
|
120
|
+
chain_types = []
|
|
121
|
+
region_annotations_list = []
|
|
122
|
+
numbering_results = []
|
|
123
|
+
|
|
124
|
+
regions_def = SCHEME_REGIONS.get(scheme, IMGT_REGIONS)
|
|
125
|
+
|
|
126
|
+
for idx in range(len(sequences)):
|
|
127
|
+
if numbered_seqs[idx] is None or len(numbered_seqs[idx]) == 0:
|
|
128
|
+
position_names_list.append('')
|
|
129
|
+
chain_types.append('')
|
|
130
|
+
region_annotations_list.append('[]')
|
|
131
|
+
numbering_results.append('')
|
|
132
|
+
continue
|
|
133
|
+
|
|
134
|
+
# Get the best hit (first domain)
|
|
135
|
+
numbering = numbered_seqs[idx][0]
|
|
136
|
+
chain_info = alignment_details[idx][0]
|
|
137
|
+
|
|
138
|
+
if numbering is None or chain_info is None:
|
|
139
|
+
position_names_list.append('')
|
|
140
|
+
chain_types.append('')
|
|
141
|
+
region_annotations_list.append('[]')
|
|
142
|
+
numbering_results.append('')
|
|
143
|
+
continue
|
|
144
|
+
|
|
145
|
+
# Extract chain type
|
|
146
|
+
chain_type_code = chain_info['chain_type']
|
|
147
|
+
if chain_type_code == 'H':
|
|
148
|
+
chain_type = 'Heavy'
|
|
149
|
+
elif chain_type_code in ('K', 'L'):
|
|
150
|
+
chain_type = 'Light'
|
|
151
|
+
else:
|
|
152
|
+
chain_type = 'Unknown'
|
|
153
|
+
|
|
154
|
+
# Build position names from numbering
|
|
155
|
+
pos_names = []
|
|
156
|
+
for (pos_num, insertion_code), aa in numbering:
|
|
157
|
+
if aa != '-':
|
|
158
|
+
pos_name = str(pos_num)
|
|
159
|
+
if insertion_code != ' ':
|
|
160
|
+
pos_name += insertion_code
|
|
161
|
+
pos_names.append(pos_name)
|
|
162
|
+
|
|
163
|
+
position_names_list.append(', '.join(pos_names))
|
|
164
|
+
chain_types.append(chain_type)
|
|
165
|
+
|
|
166
|
+
# Build region annotations
|
|
167
|
+
chain_key = chain_type if chain_type in regions_def else 'Heavy'
|
|
168
|
+
region_defs = regions_def.get(chain_key, [])
|
|
169
|
+
annotations = []
|
|
170
|
+
for region_name, start, end in region_defs:
|
|
171
|
+
region_type = 'CDR' if 'CDR' in region_name else 'FR'
|
|
172
|
+
annotations.append({
|
|
173
|
+
'id': f'{scheme}-{chain_type}-{region_name}'.lower(),
|
|
174
|
+
'name': region_name,
|
|
175
|
+
'description': f'{region_name} ({scheme.upper()} {start}-{end})',
|
|
176
|
+
'start': str(start),
|
|
177
|
+
'end': str(end),
|
|
178
|
+
'visualType': 'region',
|
|
179
|
+
'category': 'structure',
|
|
180
|
+
'sourceScheme': scheme.upper(),
|
|
181
|
+
'autoGenerated': True,
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
region_annotations_list.append(json.dumps(annotations))
|
|
185
|
+
|
|
186
|
+
# Full numbering as JSON for debugging/reference
|
|
187
|
+
numbering_json = json.dumps([
|
|
188
|
+
{'position': f'{pos_num}{insertion_code.strip()}', 'aa': aa}
|
|
189
|
+
for (pos_num, insertion_code), aa in numbering
|
|
190
|
+
if aa != '-'
|
|
191
|
+
])
|
|
192
|
+
numbering_results.append(numbering_json)
|
|
193
|
+
|
|
194
|
+
# Build result DataFrame
|
|
195
|
+
result = pd.DataFrame({
|
|
196
|
+
'position_names': position_names_list,
|
|
197
|
+
'chain_type': chain_types,
|
|
198
|
+
'annotations_json': region_annotations_list,
|
|
199
|
+
'numbering_detail': numbering_results,
|
|
200
|
+
})
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
This file is auto-generated by the grok api command.
|
|
3
|
+
If you notice any changes, please push them to the repository.
|
|
4
|
+
Do not edit this file manually.
|
|
5
|
+
*/
|
|
6
|
+
import * as grok from 'datagrok-api/grok';
|
|
7
|
+
import * as DG from 'datagrok-api/dg';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export namespace scripts {
|
|
11
|
+
/**
|
|
12
|
+
[Legacy] Assigns antibody numbering (IMGT/Kabat/Chothia/AHo) using AbNumber
|
|
13
|
+
*/
|
|
14
|
+
export async function numberAntibodySequencesAbNumber(df: DG.DataFrame , seqCol: DG.Column , scheme: string ): Promise<DG.DataFrame> {
|
|
15
|
+
return await grok.functions.call('Proteomics:NumberAntibodySequencesAbNumber', { df, seqCol, scheme });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
[Legacy] Assigns antibody numbering (IMGT/Kabat/Chothia/AHo) using ANARCI directly
|
|
20
|
+
*/
|
|
21
|
+
export async function numberAntibodySequencesANARCI(df: DG.DataFrame , seqCol: DG.Column , scheme: string ): Promise<DG.DataFrame> {
|
|
22
|
+
return await grok.functions.call('Proteomics:NumberAntibodySequencesANARCI', { df, seqCol, scheme });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
Assigns antibody numbering (IMGT/Kabat/Chothia/AHo) using AntPack
|
|
27
|
+
*/
|
|
28
|
+
export async function antpackAntibodyNumbering(df: DG.DataFrame , seqCol: DG.Column , scheme: string ): Promise<DG.DataFrame> {
|
|
29
|
+
return await grok.functions.call('Proteomics:AntpackAntibodyNumbering', { df, seqCol, scheme });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export namespace funcs {
|
|
34
|
+
export async function info(): Promise<void> {
|
|
35
|
+
return await grok.functions.call('Proteomics:Info', {});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { runTests, tests, TestContext , initAutoTests as initTests } from '@datagrok-libraries/test/src/test';
|
|
2
|
+
import * as DG from 'datagrok-api/dg';
|
|
3
|
+
|
|
4
|
+
export let _package = new DG.Package();
|
|
5
|
+
export { tests };
|
|
6
|
+
|
|
7
|
+
//name: test
|
|
8
|
+
//input: string category {optional: true}
|
|
9
|
+
//input: string test {optional: true}
|
|
10
|
+
//input: object testContext {optional: true}
|
|
11
|
+
//output: dataframe result
|
|
12
|
+
export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {
|
|
13
|
+
const data = await runTests({ category, test, testContext });
|
|
14
|
+
return DG.DataFrame.fromObjects(data)!;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//name: initAutoTests
|
|
18
|
+
export async function initAutoTests() {
|
|
19
|
+
await initTests(_package, _package.getModule('package-test.js'));
|
|
20
|
+
}
|
package/src/package.g.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import * as DG from 'datagrok-api/dg';
|
package/src/package.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
/* Do not change these import lines to match external modules in webpack configuration */
|
|
3
|
+
import * as grok from 'datagrok-api/grok';
|
|
4
|
+
import * as ui from 'datagrok-api/ui';
|
|
5
|
+
import * as DG from 'datagrok-api/dg';
|
|
6
|
+
export * from './package.g';
|
|
7
|
+
|
|
8
|
+
export const _package = new DG.Package();
|
|
9
|
+
|
|
10
|
+
//name: info
|
|
11
|
+
export function info() {
|
|
12
|
+
grok.shell.info(_package.webRoot);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class PackageFunctions {
|
|
16
|
+
|
|
17
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Basic Options */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
8
|
+
"module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
9
|
+
"lib": ["ES2022", "dom"], /* Specify library files to be included in the compilation. */
|
|
10
|
+
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
11
|
+
// "checkJs": true, /* Report errors in .js files. */
|
|
12
|
+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
|
|
13
|
+
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
14
|
+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
|
+
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
16
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
17
|
+
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
18
|
+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
19
|
+
// "composite": true, /* Enable project compilation */
|
|
20
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
21
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
|
22
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
23
|
+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
24
|
+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
25
|
+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
26
|
+
|
|
27
|
+
/* Strict Type-Checking Options */
|
|
28
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
29
|
+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
30
|
+
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
31
|
+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
32
|
+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
33
|
+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
34
|
+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
35
|
+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
36
|
+
|
|
37
|
+
/* Additional Checks */
|
|
38
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
39
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
40
|
+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
41
|
+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
42
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
43
|
+
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
|
|
44
|
+
|
|
45
|
+
/* Module Resolution Options */
|
|
46
|
+
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
47
|
+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
48
|
+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
49
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
50
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
51
|
+
// "types": [], /* Type declaration files to be included in compilation. */
|
|
52
|
+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
53
|
+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
54
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
55
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
56
|
+
|
|
57
|
+
/* Source Map Options */
|
|
58
|
+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
59
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
60
|
+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
61
|
+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
62
|
+
|
|
63
|
+
/* Experimental Options */
|
|
64
|
+
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
65
|
+
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
66
|
+
|
|
67
|
+
/* Advanced Options */
|
|
68
|
+
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
69
|
+
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const FuncGeneratorPlugin = require('datagrok-tools/plugins/func-gen-plugin');
|
|
3
|
+
const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
cache: {
|
|
7
|
+
type: 'filesystem',
|
|
8
|
+
},
|
|
9
|
+
mode: 'development',
|
|
10
|
+
entry: {
|
|
11
|
+
test: {filename: 'package-test.js', library: {type: 'var', name: `${packageName}_test`}, import: './src/package-test.ts'},
|
|
12
|
+
package: './src/package.ts',
|
|
13
|
+
},
|
|
14
|
+
resolve: {
|
|
15
|
+
extensions: ['.wasm', '.mjs', '.ts', '.json', '.js', '.tsx'],
|
|
16
|
+
},
|
|
17
|
+
module: {
|
|
18
|
+
rules: [
|
|
19
|
+
{test: /\.tsx?$/, loader: 'ts-loader', options: {allowTsInNodeModules: true}},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
plugins: [
|
|
23
|
+
new FuncGeneratorPlugin({outputPath: './src/package.g.ts'}),
|
|
24
|
+
],
|
|
25
|
+
devtool: 'source-map',
|
|
26
|
+
externals: {
|
|
27
|
+
'datagrok-api/dg': 'DG',
|
|
28
|
+
'datagrok-api/grok': 'grok',
|
|
29
|
+
'datagrok-api/ui': 'ui',
|
|
30
|
+
'openchemlib/full.js': 'OCL',
|
|
31
|
+
'rxjs': 'rxjs',
|
|
32
|
+
'rxjs/operators': 'rxjs.operators',
|
|
33
|
+
'cash-dom': '$',
|
|
34
|
+
'dayjs': 'dayjs',
|
|
35
|
+
'wu': 'wu',
|
|
36
|
+
'exceljs': 'ExcelJS',
|
|
37
|
+
'html2canvas': 'html2canvas',
|
|
38
|
+
},
|
|
39
|
+
output: {
|
|
40
|
+
filename: '[name].js',
|
|
41
|
+
library: packageName,
|
|
42
|
+
libraryTarget: 'var',
|
|
43
|
+
path: path.resolve(__dirname, 'dist'),
|
|
44
|
+
},
|
|
45
|
+
};
|