@datagrok/bio 2.11.28 → 2.11.30
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/CHANGELOG.md +12 -1
- package/dist/23.js +2 -0
- package/dist/23.js.map +1 -0
- package/dist/282.js +2 -0
- package/dist/282.js.map +1 -0
- package/dist/36.js +2 -0
- package/dist/36.js.map +1 -0
- package/dist/40.js +2 -0
- package/dist/40.js.map +1 -0
- package/dist/413.js +2 -0
- package/dist/413.js.map +1 -0
- package/dist/42.js +1 -1
- package/dist/42.js.map +1 -1
- package/dist/427.js +2 -0
- package/dist/427.js.map +1 -0
- package/dist/65.js +2 -0
- package/dist/65.js.map +1 -0
- package/dist/709.js +3 -0
- package/dist/709.js.map +1 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/files/tests/to-atomic-level-msa-fasta-input.csv +10 -0
- package/files/tests/to-atomic-level-msa-fasta-output.csv +2178 -0
- package/package.json +9 -9
- package/src/package.ts +12 -10
- package/src/tests/msa-tests.ts +2 -2
- package/src/tests/pepsea-tests.ts +1 -1
- package/src/tests/renderers-test.ts +16 -16
- package/src/tests/splitters-test.ts +7 -12
- package/src/tests/substructure-filters-tests.ts +277 -55
- package/src/tests/to-atomic-level-tests.ts +32 -22
- package/src/tests/utils/sequences-generators.ts +6 -3
- package/src/tests/utils.ts +6 -6
- package/src/utils/cell-renderer.ts +2 -0
- package/src/utils/docker.ts +36 -0
- package/src/viewers/vd-regions-viewer.ts +4 -0
- package/src/viewers/web-logo-viewer.ts +4 -0
- package/src/widgets/bio-substructure-filter-helm.ts +168 -0
- package/src/widgets/bio-substructure-filter-types.ts +131 -0
- package/src/widgets/bio-substructure-filter.ts +215 -175
- package/src/widgets/composition-analysis-widget.ts +1 -1
- package/dist/100.js +0 -2
- package/dist/100.js.map +0 -1
- package/dist/118.js +0 -2
- package/dist/118.js.map +0 -1
- package/dist/361.js +0 -2
- package/dist/361.js.map +0 -1
- package/dist/471.js +0 -2
- package/dist/471.js.map +0 -1
- package/dist/649.js +0 -2
- package/dist/649.js.map +0 -1
- package/dist/664.js +0 -2
- package/dist/664.js.map +0 -1
- package/dist/886.js +0 -3
- package/dist/886.js.map +0 -1
- /package/dist/{886.js.LICENSE.txt → 709.js.LICENSE.txt} +0 -0
|
@@ -9,43 +9,73 @@ import * as DG from 'datagrok-api/dg';
|
|
|
9
9
|
import * as grok from 'datagrok-api/grok';
|
|
10
10
|
|
|
11
11
|
import wu from 'wu';
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
12
|
+
import $ from 'cash-dom';
|
|
13
|
+
import {fromEvent, Observable, Subject, Subscription, Unsubscribable} from 'rxjs';
|
|
14
14
|
|
|
15
15
|
import {TAGS as bioTAGS, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
16
|
-
import {errInfo
|
|
17
|
-
import {delay} from '@datagrok-libraries/utils/src/test';
|
|
18
|
-
import {
|
|
16
|
+
import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
17
|
+
import {delay, testEvent} from '@datagrok-libraries/utils/src/test';
|
|
18
|
+
import {getHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
|
|
19
|
+
import {IHelmWebEditor, IWebEditorApp} from '@datagrok-libraries/bio/src/helm/types';
|
|
20
|
+
import {UnitsHandler} from '@datagrok-libraries/bio/src/utils/units-handler';
|
|
21
|
+
import {IRenderer} from '@datagrok-libraries/bio/src/types/renderer';
|
|
22
|
+
import {ILogger} from '@datagrok-libraries/bio/src/utils/logger';
|
|
23
|
+
import {PromiseSyncer} from '@datagrok-libraries/bio/src/utils/syncer';
|
|
19
24
|
|
|
20
25
|
import {helmSubstructureSearch, linearSubstructureSearch} from '../substructure-search/substructure-search';
|
|
21
26
|
import {updateDivInnerHTML} from '../utils/ui-utils';
|
|
27
|
+
import {BioFilterBase, BioFilterProps, IBioFilter, IFilterProps} from './bio-substructure-filter-types';
|
|
28
|
+
import {HelmBioFilter} from './bio-substructure-filter-helm';
|
|
22
29
|
|
|
23
30
|
import {_package} from '../package';
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
const FILTER_SYNC_EVENT: string = 'bio-substructure-filter';
|
|
33
|
+
|
|
34
|
+
class FilterState {
|
|
35
|
+
constructor(
|
|
36
|
+
public readonly props: IFilterProps,
|
|
37
|
+
public readonly filterId: number,
|
|
38
|
+
public readonly dataFrameId: string,
|
|
39
|
+
public readonly columnName: string,
|
|
40
|
+
public readonly bitset: DG.BitSet | null,
|
|
41
|
+
) {}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class SeparatorFilterProps extends BioFilterProps {
|
|
45
|
+
constructor(
|
|
46
|
+
substructure: string,
|
|
47
|
+
public separator?: string
|
|
48
|
+
) {
|
|
49
|
+
super(substructure);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class BioSubstructureFilter extends DG.Filter implements IRenderer {
|
|
54
|
+
bioFilter: IBioFilter | null = null;
|
|
27
55
|
bitset: DG.BitSet | null = null;
|
|
28
|
-
loader: HTMLDivElement
|
|
29
|
-
onBioFilterChangedSubs?: Subscription;
|
|
56
|
+
readonly loader: HTMLDivElement;
|
|
30
57
|
notation: string | undefined = undefined;
|
|
31
58
|
|
|
59
|
+
readonly logger: ILogger;
|
|
60
|
+
readonly filterSyncer: PromiseSyncer;
|
|
61
|
+
|
|
32
62
|
get calculating(): boolean { return this.loader.style.display == 'initial'; }
|
|
33
63
|
|
|
34
64
|
set calculating(value: boolean) { this.loader.style.display = value ? 'initial' : 'none'; }
|
|
35
65
|
|
|
36
66
|
get filterSummary(): string {
|
|
37
|
-
return this.bioFilter!.
|
|
67
|
+
return this.bioFilter!.filterSummary;
|
|
38
68
|
}
|
|
39
69
|
|
|
40
70
|
get isFiltering(): boolean {
|
|
41
|
-
return super.isFiltering && this.bioFilter
|
|
71
|
+
return super.isFiltering && (this.bioFilter?.isFiltering ?? false);
|
|
42
72
|
}
|
|
43
73
|
|
|
44
74
|
get isReadyToApplyFilter(): boolean {
|
|
45
75
|
return !this.calculating && this.bitset != null;
|
|
46
76
|
}
|
|
47
77
|
|
|
48
|
-
get
|
|
78
|
+
get debounceTime(): number {
|
|
49
79
|
if (this.column == null)
|
|
50
80
|
return 1000;
|
|
51
81
|
const length = this.column.length;
|
|
@@ -54,44 +84,85 @@ export class BioSubstructureFilter extends DG.Filter {
|
|
|
54
84
|
const msecMax = 1000;
|
|
55
85
|
if (length < minLength) return 0;
|
|
56
86
|
if (length > maxLength) return msecMax;
|
|
57
|
-
|
|
87
|
+
const res = Math.floor(msecMax * ((length - minLength) / (maxLength - minLength)));
|
|
88
|
+
return res;
|
|
58
89
|
}
|
|
59
90
|
|
|
60
|
-
//column name setter overload
|
|
61
|
-
|
|
62
91
|
constructor() {
|
|
63
92
|
super();
|
|
64
93
|
this.root = ui.divV([]);
|
|
94
|
+
this.loader = ui.loader();
|
|
65
95
|
this.calculating = false;
|
|
96
|
+
this.filterSyncer = new PromiseSyncer(this.logger = _package.logger);
|
|
97
|
+
|
|
98
|
+
return new Proxy(this, {
|
|
99
|
+
set(target: any, key, value) {
|
|
100
|
+
if (key === 'column') {
|
|
101
|
+
const k = 42;
|
|
102
|
+
}
|
|
103
|
+
target[key] = value;
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
66
107
|
}
|
|
67
108
|
|
|
109
|
+
private static filterCounter: number = -1;
|
|
110
|
+
private readonly filterId: number = ++BioSubstructureFilter.filterCounter;
|
|
111
|
+
|
|
112
|
+
private filterToLog(): string { return `BioSubstructureFilter<${this.filterId}>`; }
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
private viewSubs: Unsubscribable[] = [];
|
|
116
|
+
|
|
68
117
|
attach(dataFrame: DG.DataFrame): void {
|
|
69
|
-
super.attach(
|
|
70
|
-
|
|
71
|
-
this.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
118
|
+
const superAttach = super.attach.bind(this);
|
|
119
|
+
const logPrefix = `${this.filterToLog()}.attach()`;
|
|
120
|
+
this.filterSyncer.sync(logPrefix, async () => {
|
|
121
|
+
superAttach(dataFrame);
|
|
122
|
+
this.column = dataFrame.columns.bySemType(DG.SEMTYPE.MACROMOLECULE);
|
|
123
|
+
const uh = UnitsHandler.getOrCreate(this.column!);
|
|
124
|
+
this.columnName ??= this.column?.name;
|
|
125
|
+
this.notation ??= this.column?.getTag(DG.TAGS.UNITS);
|
|
126
|
+
|
|
127
|
+
this.bioFilter = this.notation === NOTATION.FASTA ?
|
|
128
|
+
new FastaBioFilter() : this.notation === NOTATION.SEPARATOR ?
|
|
129
|
+
new SeparatorBioFilter(this.column!.getTag(bioTAGS.separator)) : new HelmBioFilter();
|
|
130
|
+
this.root.appendChild(this.bioFilter!.filterPanel);
|
|
131
|
+
this.root.appendChild(this.loader);
|
|
132
|
+
await this.bioFilter.attach(); // may await waitForElementInDom
|
|
133
|
+
|
|
134
|
+
this.viewSubs.push(DG.debounce(this.bioFilter!.onChanged, this.debounceTime)
|
|
135
|
+
.subscribe(this.bioFilterOnChangedDebounced.bind(this)));
|
|
136
|
+
this.viewSubs.push(grok.events.onResetFilterRequest
|
|
137
|
+
.subscribe((_value: any) => { this.bioFilter?.resetFilter(); }));
|
|
138
|
+
this.viewSubs.push(grok.events.onCustomEvent(FILTER_SYNC_EVENT)
|
|
139
|
+
.subscribe(this.filterOnSync.bind(this)));
|
|
140
|
+
});
|
|
88
141
|
}
|
|
89
142
|
|
|
90
143
|
detach() {
|
|
91
|
-
|
|
92
|
-
|
|
144
|
+
const superDetach = super.detach.bind(this);
|
|
145
|
+
const logPrefix = `${this.filterToLog()}.detach()`;
|
|
146
|
+
this.filterSyncer.sync(logPrefix, async () => {
|
|
147
|
+
for (const sub of this.viewSubs) sub.unsubscribe();
|
|
148
|
+
this.viewSubs = [];
|
|
149
|
+
superDetach(); // requests this.isFiltering
|
|
150
|
+
if (this.bioFilter) this.bioFilter.detach();
|
|
151
|
+
this.bioFilter = null;
|
|
152
|
+
});
|
|
93
153
|
}
|
|
94
154
|
|
|
155
|
+
// -- Sync -
|
|
156
|
+
|
|
157
|
+
private filterOnSync(state: FilterState): void {
|
|
158
|
+
if (state.filterId === this.filterId) return;
|
|
159
|
+
if (state.dataFrameId !== this.dataFrame!.id || state.columnName !== this.columnName) return;
|
|
160
|
+
|
|
161
|
+
this.bioFilter!.props = state.props;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// -- Layout --
|
|
165
|
+
|
|
95
166
|
applyFilter(): void {
|
|
96
167
|
if (this.bitset && !this.isDetached)
|
|
97
168
|
this.dataFrame?.filter.and(this.bitset);
|
|
@@ -102,7 +173,7 @@ export class BioSubstructureFilter extends DG.Filter {
|
|
|
102
173
|
*/
|
|
103
174
|
saveState(): any {
|
|
104
175
|
const state = super.saveState();
|
|
105
|
-
state.
|
|
176
|
+
state.props = this.bioFilter!.props.save();
|
|
106
177
|
return state;
|
|
107
178
|
}
|
|
108
179
|
|
|
@@ -111,105 +182,165 @@ export class BioSubstructureFilter extends DG.Filter {
|
|
|
111
182
|
*/
|
|
112
183
|
applyState(state: any): void {
|
|
113
184
|
super.applyState(state); //column, columnName
|
|
114
|
-
if (state.
|
|
115
|
-
this.bioFilter!.
|
|
185
|
+
if (state.props)
|
|
186
|
+
this.bioFilter!.props.apply(state.props);
|
|
187
|
+
|
|
188
|
+
// if (state.bioSubstructure) {
|
|
189
|
+
// // (async () => { await this.bioFilterOnChangedDebounced(); })();
|
|
190
|
+
// this.bioFilter!.substructure = state.bioSubstructure;
|
|
191
|
+
// }
|
|
192
|
+
}
|
|
116
193
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
194
|
+
private fireFilterSync(): void {
|
|
195
|
+
const logPrefix = `${this.filterToLog()}.fireFilterSync()`;
|
|
196
|
+
_package.logger.debug(`${logPrefix}, ` +
|
|
197
|
+
`bioFilter = ${!!this.bioFilter ? this.bioFilter.constructor.name : 'null'}` +
|
|
198
|
+
(!!this.bioFilter ? `, props = ${JSON.stringify(this.bioFilter!.props.save())}` : ''));
|
|
199
|
+
|
|
200
|
+
grok.events.fireCustomEvent(FILTER_SYNC_EVENT, new FilterState(
|
|
201
|
+
this.bioFilter!.props, this.filterId, this.dataFrame!.id, this.columnName!, this.bitset));
|
|
120
202
|
}
|
|
121
203
|
|
|
204
|
+
// -- Handle events
|
|
205
|
+
|
|
122
206
|
/**
|
|
123
207
|
* Performs the actual filtering
|
|
124
208
|
* When the results are ready, triggers `rows.requestFilter`, which in turn triggers `applyFilter`
|
|
125
209
|
* that would simply apply the bitset synchronously.
|
|
126
210
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
211
|
+
bioFilterOnChangedDebounced(): void {
|
|
212
|
+
if (!this.dataFrame) return; // Debounced event can be handled postponed
|
|
213
|
+
const logPrefix = `${this.filterToLog()}.bioFilterOnChangedDebounced()`;
|
|
214
|
+
_package.logger.debug(`${logPrefix}, start, ` +
|
|
215
|
+
`isFiltering = ${this.isFiltering}, ` +
|
|
216
|
+
`props = ${JSON.stringify(this.bioFilter!.props.save())}`);
|
|
217
|
+
|
|
129
218
|
if (!this.isFiltering) {
|
|
130
219
|
this.bitset = null;
|
|
131
|
-
this.dataFrame
|
|
132
|
-
|
|
133
|
-
|
|
220
|
+
this.dataFrame!.rows.requestFilter();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// some other filter is already filtering for the exact same thing
|
|
225
|
+
if (wu(this.dataFrame!.rows.filters).has(`${this.columnName}: ${this.filterSummary}`))
|
|
134
226
|
return;
|
|
135
|
-
|
|
227
|
+
|
|
228
|
+
this.filterSyncer.sync(logPrefix, async () => {
|
|
136
229
|
this.calculating = true;
|
|
137
230
|
try {
|
|
231
|
+
_package.logger.debug(`${logPrefix}, before substructureSearch`);
|
|
138
232
|
this.bitset = await this.bioFilter?.substructureSearch(this.column!)!;
|
|
233
|
+
_package.logger.debug(`${logPrefix}, after substructureSearch`);
|
|
139
234
|
this.calculating = false;
|
|
235
|
+
this.fireFilterSync();
|
|
140
236
|
this.dataFrame?.rows.requestFilter();
|
|
141
237
|
} finally {
|
|
142
238
|
this.calculating = false;
|
|
239
|
+
_package.logger.debug(`${logPrefix}, end`);
|
|
143
240
|
}
|
|
144
|
-
}
|
|
241
|
+
});
|
|
145
242
|
}
|
|
146
|
-
}
|
|
147
243
|
|
|
148
|
-
|
|
149
|
-
onChanged: Subject<any> = new Subject<any>();
|
|
244
|
+
// -- IRenderer --
|
|
150
245
|
|
|
151
|
-
|
|
152
|
-
return new HTMLElement();
|
|
153
|
-
}
|
|
246
|
+
private _onRendered = new Subject<void>();
|
|
154
247
|
|
|
155
|
-
|
|
156
|
-
abstract set substructure(s: string);
|
|
248
|
+
get onRendered(): Observable<void> { return this._onRendered; }
|
|
157
249
|
|
|
158
|
-
|
|
159
|
-
|
|
250
|
+
invalidate(caller?: string): void {
|
|
251
|
+
const logPrefix = `${this.filterToLog()}.invalidate(${caller ? ` <- ${caller} ` : ''})`;
|
|
252
|
+
this.filterSyncer.sync(logPrefix, async () => { this._onRendered.next(); });
|
|
160
253
|
}
|
|
161
254
|
|
|
162
|
-
|
|
255
|
+
async awaitRendered(timeout: number = 10000): Promise<void> {
|
|
256
|
+
const callLog = `awaitRendered( ${timeout} )`;
|
|
257
|
+
const logPrefix = `${this.filterToLog()}.${callLog}`;
|
|
258
|
+
await delay(0);
|
|
259
|
+
await testEvent(this.onRendered, () => {
|
|
260
|
+
this.logger.debug(`${logPrefix}, ` + '_onRendered event caught');
|
|
261
|
+
}, () => {
|
|
262
|
+
this.invalidate(callLog);
|
|
263
|
+
}, timeout, `${logPrefix} ${timeout} timeout`);
|
|
163
264
|
|
|
164
|
-
|
|
265
|
+
// Rethrow stored syncer error (for test purposes)
|
|
266
|
+
const viewErrors = this.filterSyncer.resetErrors();
|
|
267
|
+
if (viewErrors.length > 0) throw viewErrors[0];
|
|
268
|
+
}
|
|
165
269
|
}
|
|
166
270
|
|
|
167
|
-
class
|
|
271
|
+
export class FastaBioFilter extends BioFilterBase<BioFilterProps> {
|
|
272
|
+
readonly emptyProps = new BioFilterProps('');
|
|
273
|
+
|
|
168
274
|
readonly substructureInput: DG.InputBase<string>;
|
|
169
275
|
|
|
276
|
+
get type(): string { return 'FastaBioFilter'; }
|
|
277
|
+
|
|
170
278
|
constructor() {
|
|
171
279
|
super();
|
|
172
280
|
|
|
173
281
|
this.substructureInput = ui.stringInput('', '', () => {
|
|
174
|
-
this.
|
|
282
|
+
this.props.substructure = this.substructureInput.value;
|
|
283
|
+
if (!this._propsChanging) this.onChanged.next();
|
|
175
284
|
}, {placeholder: 'Substructure'});
|
|
176
285
|
}
|
|
177
286
|
|
|
178
|
-
|
|
179
|
-
|
|
287
|
+
public applyProps() {
|
|
288
|
+
this.substructureInput.value = this.props.substructure;
|
|
180
289
|
}
|
|
181
290
|
|
|
182
|
-
get
|
|
183
|
-
return this.substructureInput.
|
|
291
|
+
get filterPanel() {
|
|
292
|
+
return this.substructureInput.root;
|
|
184
293
|
}
|
|
185
294
|
|
|
186
|
-
|
|
187
|
-
this.substructureInput.value = s;
|
|
188
|
-
}
|
|
295
|
+
get isFiltering(): boolean { return this.substructureInput.value !== ''; }
|
|
189
296
|
|
|
190
297
|
async substructureSearch(column: DG.Column): Promise<DG.BitSet | null> {
|
|
191
|
-
return linearSubstructureSearch(this.substructure, column);
|
|
298
|
+
return linearSubstructureSearch(this.props.substructure, column);
|
|
192
299
|
}
|
|
193
300
|
|
|
194
|
-
|
|
195
|
-
this.substructureInput.value = '';
|
|
196
|
-
}
|
|
301
|
+
async attach(): Promise<void> {}
|
|
197
302
|
|
|
198
|
-
detach(): void {
|
|
303
|
+
async detach(): Promise<void> {
|
|
304
|
+
await super.detach();
|
|
305
|
+
}
|
|
199
306
|
}
|
|
200
307
|
|
|
201
|
-
export class
|
|
308
|
+
export class SeparatorBioFilter extends BioFilterBase<SeparatorFilterProps> {
|
|
309
|
+
readonly emptyProps = new SeparatorFilterProps('');
|
|
310
|
+
|
|
311
|
+
readonly substructureInput: DG.InputBase<string>;
|
|
202
312
|
readonly separatorInput: DG.InputBase<string>;
|
|
203
313
|
colSeparator = '';
|
|
204
314
|
|
|
205
|
-
|
|
315
|
+
get type(): string { return 'SeparatorBioFilter'; }
|
|
316
|
+
|
|
317
|
+
constructor(colSeparator: string) {
|
|
206
318
|
super();
|
|
207
319
|
|
|
208
|
-
this.
|
|
209
|
-
this.
|
|
320
|
+
this.substructureInput = ui.stringInput('', '', () => {
|
|
321
|
+
this.props.substructure = this.substructureInput.value;
|
|
322
|
+
if (!this._propsChanging) this.onChanged.next();
|
|
323
|
+
}, {placeholder: 'Substructure'});
|
|
324
|
+
this.separatorInput = ui.stringInput('', this.colSeparator = colSeparator, () => {
|
|
325
|
+
this.props.separator = !!this.separatorInput.value ? this.separatorInput.value : undefined;
|
|
326
|
+
if (!this._propsChanging) this.onChanged.next();
|
|
210
327
|
}, {placeholder: 'Separator'});
|
|
211
|
-
|
|
212
|
-
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
applyProps(): void {
|
|
331
|
+
this.substructureInput.value = this.props.substructure;
|
|
332
|
+
this.separatorInput.value = this.props.separator ?? this.colSeparator;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
get filterSummary(): string {
|
|
336
|
+
const sep: string = this.props.separator ? this.props.separator : this.colSeparator;
|
|
337
|
+
return `${this.props.substructure}, {sep}`;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
get isFiltering(): boolean { return this.props.substructure !== ''; };
|
|
341
|
+
|
|
342
|
+
resetFilter(): void {
|
|
343
|
+
this.props = new SeparatorFilterProps('');
|
|
213
344
|
}
|
|
214
345
|
|
|
215
346
|
get filterPanel() {
|
|
@@ -233,100 +364,9 @@ export class SeparatorFilter extends FastaFilter {
|
|
|
233
364
|
return linearSubstructureSearch(this.substructure, column, this.colSeparator);
|
|
234
365
|
}
|
|
235
366
|
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export class HelmFilter extends BioFilterBase {
|
|
240
|
-
helmEditor: IHelmWebEditor;
|
|
241
|
-
_filterPanel = ui.div('', {style: {cursor: 'pointer'}});
|
|
242
|
-
helmSubstructure = '';
|
|
243
|
-
|
|
244
|
-
constructor() {
|
|
245
|
-
super();
|
|
246
|
-
this.init();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
viewSubs: Unsubscribable[] = [];
|
|
250
|
-
|
|
251
|
-
async init() {
|
|
252
|
-
this.helmEditor = await grok.functions.call('Helm:helmWebEditor');
|
|
253
|
-
await ui.tools.waitForElementInDom(this._filterPanel);
|
|
254
|
-
this.updateFilterPanel();
|
|
255
|
-
let editorDiv: HTMLDivElement | undefined;
|
|
256
|
-
let webEditor: any | undefined;
|
|
257
|
-
// TODO: Unsubscribe 'click' and 'sizeChanged'
|
|
258
|
-
this.viewSubs.push(fromEvent(this._filterPanel, 'click').subscribe(() => {
|
|
259
|
-
({editorDiv, webEditor} = this.helmEditor.createWebEditor(this.helmSubstructure));
|
|
260
|
-
const dlg = ui.dialog({showHeader: false, showFooter: true})
|
|
261
|
-
.add(editorDiv)
|
|
262
|
-
.onOK(() => {
|
|
263
|
-
const helmString = webEditor.canvas.getHelm(true)
|
|
264
|
-
.replace(/<\/span>/g, '').replace(/<span style='background:#bbf;'>/g, '');
|
|
265
|
-
this.helmSubstructure = helmString;
|
|
266
|
-
this.updateFilterPanel(this.substructure);
|
|
267
|
-
setTimeout(() => { this.onChanged.next(); }, 10);
|
|
268
|
-
}).show({modal: true, fullScreen: true});
|
|
269
|
-
const onCloseSub = dlg.onClose.subscribe(() => {
|
|
270
|
-
onCloseSub.unsubscribe();
|
|
271
|
-
editorDiv = undefined;
|
|
272
|
-
webEditor = undefined;
|
|
273
|
-
});
|
|
274
|
-
}));
|
|
275
|
-
this.viewSubs.push(ui.onSizeChanged(this._filterPanel).subscribe((_) => {
|
|
276
|
-
try {
|
|
277
|
-
if (!!webEditor) {
|
|
278
|
-
const helmString = webEditor.canvas.getHelm(true)
|
|
279
|
-
.replace(/<\/span>/g, '').replace(/<span style='background:#bbf;'>/g, '');
|
|
280
|
-
this.updateFilterPanel(helmString);
|
|
281
|
-
}
|
|
282
|
-
} catch (err: any) {
|
|
283
|
-
const [errMsg, errStack] = errInfo(err);
|
|
284
|
-
_package.logger.error(errMsg, undefined, errStack);
|
|
285
|
-
}
|
|
286
|
-
}));
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
get filterPanel() {
|
|
290
|
-
return this._filterPanel;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
get substructure() {
|
|
294
|
-
return this.helmSubstructure;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
set substructure(s: string) {
|
|
298
|
-
this.helmEditor.editor.setHelm(s);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
updateFilterPanel(helmString?: string) {
|
|
302
|
-
const width = this._filterPanel.parentElement!.clientWidth < 100 ? 100 :
|
|
303
|
-
this._filterPanel.parentElement!.clientWidth;
|
|
304
|
-
const height = width / 2;
|
|
305
|
-
if (!helmString) {
|
|
306
|
-
const editDiv = ui.divText('Click to edit', 'helm-substructure-filter');
|
|
307
|
-
updateDivInnerHTML(this._filterPanel, editDiv);
|
|
308
|
-
} else {
|
|
309
|
-
updateDivInnerHTML(this._filterPanel, this.helmEditor.host);
|
|
310
|
-
this.helmEditor.editor.setHelm(helmString);
|
|
311
|
-
this.helmEditor.resizeEditor(width, height);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
async substructureSearch(column: DG.Column): Promise<DG.BitSet | null> {
|
|
316
|
-
ui.setUpdateIndicator(this._filterPanel, true);
|
|
317
|
-
await delay(10);
|
|
318
|
-
const res = await helmSubstructureSearch(this.substructure, column);
|
|
319
|
-
ui.setUpdateIndicator(this._filterPanel, false);
|
|
320
|
-
return res;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
resetFilter(): void {
|
|
324
|
-
console.debug('Bio: HelmFilter.resetFilter()');
|
|
325
|
-
this.helmSubstructure = '';
|
|
326
|
-
this.updateFilterPanel(this.substructure);
|
|
327
|
-
}
|
|
367
|
+
async attach(): Promise<void> {}
|
|
328
368
|
|
|
329
|
-
detach(): void {
|
|
330
|
-
|
|
369
|
+
async detach(): Promise<void> {
|
|
370
|
+
await super.detach();
|
|
331
371
|
}
|
|
332
372
|
}
|
|
@@ -11,7 +11,7 @@ import '../../css/composition-analysis.css';
|
|
|
11
11
|
import {UnitsHandler} from '@datagrok-libraries/bio/src/utils/units-handler';
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
export function getCompositionAnalysisWidget(val: DG.SemanticValue) {
|
|
14
|
+
export function getCompositionAnalysisWidget(val: DG.SemanticValue): DG.Widget {
|
|
15
15
|
const host = ui.div();
|
|
16
16
|
host.classList.add('macromolecule-cell-comp-analysis-host');
|
|
17
17
|
const alphabet = val.cell.column.tags[bioTAGS.alphabet];
|
package/dist/100.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var bio;(()=>{"use strict";var r,e,t={7100:(r,e,t)=>{var o,a;(a=o||(o={})).EUCLIDEAN="EUCLIDEAN",a.MANHATTAN="MANHATTAN";const n=r=>null==r;var i=t(6361),s=t(9657);onmessage=r=>{const{values:e,fnName:t,startRow:o,startCol:a,chunckSize:c,opts:l}=r.data,p={};try{let r=o,u=a,f=0,v=0,h=Number.MIN_VALUE;if((0,i.sQ)(t))for(let r=0;r<e.length;++r)n(e[r])||(e[r]=new s.Z(e[r]._data,e[r]._length));const g=new Float32Array(c),b=new i.UH(t).getMeasure(l);for(;f<c;){const t=n(e[r])||n(e[u])?1:b(e[r],e[u]);g[f]=t,t<v&&(v=t),t>h&&(h=t),f++,u++,u===e.length&&(r++,u=r+1)}p.distanceMatrixData=g,p.min=v,p.max=h}catch(r){p.error=r}postMessage(p)}}},o={};function a(r){var e=o[r];if(void 0!==e)return e.exports;var n=o[r]={exports:{}};return t[r](n,n.exports,a),n.exports}a.m=t,a.x=()=>{var r=a.O(void 0,[649,361],(()=>a(7100)));return a.O(r)},r=[],a.O=(e,t,o,n)=>{if(!t){var i=1/0;for(p=0;p<r.length;p++){for(var[t,o,n]=r[p],s=!0,c=0;c<t.length;c++)(!1&n||i>=n)&&Object.keys(a.O).every((r=>a.O[r](t[c])))?t.splice(c--,1):(s=!1,n<i&&(i=n));if(s){r.splice(p--,1);var l=o();void 0!==l&&(e=l)}}return e}n=n||0;for(var p=r.length;p>0&&r[p-1][2]>n;p--)r[p]=r[p-1];r[p]=[t,o,n]},a.d=(r,e)=>{for(var t in e)a.o(e,t)&&!a.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},a.f={},a.e=r=>Promise.all(Object.keys(a.f).reduce(((e,t)=>(a.f[t](r,e),e)),[])),a.u=r=>r+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),a.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r;a.g.importScripts&&(r=a.g.location+"");var e=a.g.document;if(!r&&e&&(e.currentScript&&(r=e.currentScript.src),!r)){var t=e.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&!r;)r=t[o--].src}if(!r)throw new Error("Automatic publicPath is not supported in this browser");r=r.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=r})(),(()=>{var r={100:1};a.f.i=(e,t)=>{r[e]||importScripts(a.p+a.u(e))};var e=self.webpackChunkbio=self.webpackChunkbio||[],t=e.push.bind(e);e.push=e=>{var[o,n,i]=e;for(var s in n)a.o(n,s)&&(a.m[s]=n[s]);for(i&&i(a);o.length;)r[o.pop()]=1;t(e)}})(),e=a.x,a.x=()=>Promise.all([a.e(649),a.e(361)]).then(e);var n=a.x();bio=n})();
|
|
2
|
-
//# sourceMappingURL=100.js.map
|
package/dist/100.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"100.js","mappings":"+BAAIA,ECAAC,E,kBCAG,IAAI,EACAC,KAGR,IAA+B,EAA6B,CAAC,IAFtB,UAAI,YAC1CA,EAAsC,UAAI,YCFvC,MAAMC,EAASC,GAAMA,Q,wBCE5BC,UAAaC,IACT,MAAM,OAAEC,EAAM,OAAEC,EAAM,SAAEC,EAAQ,SAAEC,EAAQ,WAAEC,EAAU,KAAEC,GAASN,EAAMO,KACjEA,EAAO,CAAC,EACd,IAGI,IAAIC,EAAIL,EACJM,EAAIL,EACJM,EAAM,EACNC,EAAO,EACPC,EAAOC,OAAOC,UAClB,IAAI,QAAiBZ,GACjB,IAAK,IAAIM,EAAI,EAAGA,EAAIP,EAAOc,SAAUP,EAC7BX,EAAMI,EAAOO,MAEjBP,EAAOO,GAAK,IAAI,IAASP,EAAOO,GAAGQ,MAAOf,EAAOO,GAAGS,UAG5D,MAAMC,EAAS,IAAIC,aAAad,GAC1Be,EAAa,IAAI,KAAQlB,GAAQmB,WAAWf,GAClD,KAAOI,EAAML,GAAY,CACrB,MAAMiB,EAASzB,EAAMI,EAAOO,KAAQX,EAAMI,EAAOQ,IACV,EAAnCW,EAAWnB,EAAOO,GAAIP,EAAOQ,IACjCS,EAAOR,GAAOY,EACVA,EAAQX,IACRA,EAAOW,GACPA,EAAQV,IACRA,EAAOU,GACXZ,IACAD,IACIA,IAAMR,EAAOc,SACbP,IACAC,EAAID,EAAI,EAEhB,CACAD,EAAKgB,mBAAqBL,EAC1BX,EAAKiB,IAAMb,EACXJ,EAAKkB,IAAMb,CACf,CACA,MAAOc,GACHnB,EAAKoB,MAAQD,CACjB,CACAE,YAAYr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KAE/BuB,EAAgB3B,IAElBiB,cAAc/C,EAAoBwD,EAAIxD,EAAoBmC,EAAEL,GAE9D,EAGD,IAAI4B,EAAqBC,KAAsB,gBAAIA,KAAsB,iBAAK,GAC1EC,EAA6BF,EAAmBG,KAAKC,KAAKJ,GAC9DA,EAAmBG,KAvBCpF,IACnB,IAAKkC,EAAUoD,EAAaC,GAAWvF,EACvC,IAAI,IAAIwB,KAAY8D,EAChB/D,EAAoByB,EAAEsC,EAAa9D,KACrCD,EAAoBO,EAAEN,GAAY8D,EAAY9D,IAIhD,IADG+D,GAASA,EAAQhE,GACdW,EAAS1B,QACdwE,EAAgB9C,EAASsD,OAAS,EACnCL,EAA2BnF,EAAK,C,KXnB7BZ,EAAOmC,EAAoBhC,EAC/BgC,EAAoBhC,EAAI,IAChB+D,QAAQC,IAAI,CAClBhC,EAAoBJ,EAAE,KACtBI,EAAoBJ,EAAE,OACpBsE,KAAKrG,GYJT,IAAI2C,EAAsBR,EAAoBhC,I","sources":["webpack://bio/webpack/runtime/chunk loaded","webpack://bio/webpack/runtime/startup chunk dependencies","webpack://bio/./node_modules/@datagrok-libraries/ml/src/distance-matrix/types.js","webpack://bio/./node_modules/@datagrok-libraries/ml/src/distance-matrix/utils.js","webpack://bio/./node_modules/@datagrok-libraries/ml/src/distance-matrix/distance-matrix-worker.js","webpack://bio/webpack/bootstrap","webpack://bio/webpack/runtime/define property getters","webpack://bio/webpack/runtime/ensure chunk","webpack://bio/webpack/runtime/get javascript chunk filename","webpack://bio/webpack/runtime/global","webpack://bio/webpack/runtime/hasOwnProperty shorthand","webpack://bio/webpack/runtime/publicPath","webpack://bio/webpack/runtime/importScripts chunk loading","webpack://bio/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([\n\t\t__webpack_require__.e(649),\n\t\t__webpack_require__.e(361)\n\t]).then(next);\n};","export var DistanceAggregationMethods;\n(function (DistanceAggregationMethods) {\n DistanceAggregationMethods[\"EUCLIDEAN\"] = \"EUCLIDEAN\";\n DistanceAggregationMethods[\"MANHATTAN\"] = \"MANHATTAN\";\n})(DistanceAggregationMethods || (DistanceAggregationMethods = {}));\n;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ0eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSwwQkFHVDtBQUhILFdBQVksMEJBQTBCO0lBQ2xDLHFEQUF1QixDQUFBO0lBQ3ZCLHFEQUF1QixDQUFBO0FBQ3pCLENBQUMsRUFIUywwQkFBMEIsS0FBMUIsMEJBQTBCLFFBR25DO0FBQUEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIERpc3RhbmNlQWdncmVnYXRpb25NZXRob2RzIHtcbiAgICBFVUNMSURFQU4gPSAnRVVDTElERUFOJyxcbiAgICBNQU5IQVRUQU4gPSAnTUFOSEFUVEFOJyxcbiAgfTtcblxuZXhwb3J0IHR5cGUgRGlzdGFuY2VBZ2dyZWdhdGlvbk1ldGhvZCA9IGtleW9mIHR5cGVvZiBEaXN0YW5jZUFnZ3JlZ2F0aW9uTWV0aG9kcztcbiJdfQ==","import { DistanceAggregationMethods } from './types';\nexport const isNil = (x) => x === null || x === undefined;\nexport function insertSmaller(distancesAr, indexes, num, index) {\n if (num > distancesAr[distancesAr.length - 1])\n return;\n const newPosition = distancesAr.findIndex((v) => num < v);\n distancesAr.pop();\n distancesAr.splice(newPosition, 0, num);\n indexes.pop();\n indexes.splice(newPosition, 0, index);\n}\nexport function insertLarger(distancesAr, indexes, num, index) {\n if (num < distancesAr[distancesAr.length - 1])\n return;\n const newPosition = distancesAr.findIndex((v) => num > v);\n distancesAr.pop();\n distancesAr.splice(newPosition, 0, num);\n indexes.pop();\n indexes.splice(newPosition, 0, index);\n}\nexport function getAggregationFunction(aggregationMethod, weights) {\n switch (aggregationMethod) {\n case DistanceAggregationMethods.MANHATTAN:\n return (vs) => vs.reduce((acc, val, idx) => acc + val * weights[idx], 0);\n default:\n return (vs) => {\n // euclidean\n const sum = vs.reduce((acc, val, idx) => acc + (val * weights[idx]) ** 2, 0);\n return Math.sqrt(sum);\n };\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ1dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQTRCLDBCQUEwQixFQUFDLE1BQU0sU0FBUyxDQUFDO0FBRTlFLE1BQU0sQ0FBQyxNQUFNLEtBQUssR0FBRyxDQUFDLENBQU0sRUFBRSxFQUFFLENBQUMsQ0FBQyxLQUFLLElBQUksSUFBSS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0YW5jZUFnZ3JlZ2F0aW9uTWV0aG9kLCB3ZWlnaHRzOiBudW1iZXJbXVxuKTogKHZhbHVlczogbnVtYmVyW10pID0+IG51bWJlciB7XG4gIHN3aXRjaCAoYWdncmVnYXRpb25NZXRob2QpIHtcbiAgICBjYXNlIERpc3RhbmNlQWdncmVnYXRpb25NZXRob2RzLk1BTkhBVFRBTjpcbiAgICAgIHJldHVybiAodnM6IG51bWJlcltdKSA9PiB2cy5yZWR1Y2UoKGFjYywgdmFsLCBpZHgpID0+IGFjYyArIHZhbCAqIHdlaWdodHNbaWR4XSwgMCk7XG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiAodnM6IG51bWJlcltdKSA9PiB7XG4gICAgICAgIC8vIGV1Y2xpZGVhblxuICAgICAgICBjb25zdCBzdW0gPSB2cy5yZWR1Y2UoKGFjYywgdmFsLCBpZHgpID0+IGFjYyArICh2YWwgKiB3ZWlnaHRzW2lkeF0pICoqIDIsIDApO1xuICAgICAgICByZXR1cm4gTWF0aC5zcXJ0KHN1bSk7XG4gICAgICB9O1xuICB9XG59XG4iXX0=","import { isNil } from './utils';\nimport { Measure, isBitArrayMetric } from '../typed-metrics';\nimport BitArray from '@datagrok-libraries/utils/src/bit-array';\nonmessage = (event) => {\n const { values, fnName, startRow, startCol, chunckSize, opts } = event.data;\n const data = {};\n try {\n // if (startRow != -1)\n // throw new Error('Error in distance matrix worker'); // TODO: remove this line\n let i = startRow;\n let j = startCol;\n let cnt = 0;\n let lmin = 0;\n let lmax = Number.MIN_VALUE;\n if (isBitArrayMetric(fnName)) {\n for (let i = 0; i < values.length; ++i) {\n if (isNil(values[i]))\n continue;\n values[i] = new BitArray(values[i]._data, values[i]._length);\n }\n }\n const retVal = new Float32Array(chunckSize);\n const distanceFn = new Measure(fnName).getMeasure(opts);\n while (cnt < chunckSize) {\n const value = !isNil(values[i]) && !isNil(values[j]) ?\n distanceFn(values[i], values[j]) : 1;\n retVal[cnt] = value;\n if (value < lmin)\n lmin = value;\n if (value > lmax)\n lmax = value;\n cnt++;\n j++;\n if (j === values.length) {\n i++;\n j = i + 1;\n }\n }\n data.distanceMatrixData = retVal;\n data.min = lmin;\n data.max = lmax;\n }\n catch (e) {\n data.error = e;\n }\n postMessage(data);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlzdGFuY2UtbWF0cml4LXdvcmtlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImRpc3RhbmNlLW1hdHJpeC13b3JrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLEtBQUssRUFBQyxNQUFNLFNBQVMsQ0FBQztBQUM5QixPQUFPLEVBQUMsT0FBTyxFQUFFLGdCQUFnQixFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDM0QsT0FBTyxRQUFRLE1BQU0seUNBQXlDLENBQUM7QUFFL0QsU0FBUyxHQUFHLENBQUMsS0FBSyxFQUFFLEVBQUU7SUFDcEIsTUFBTSxFQUFDLE1BQU0sRUFBRSxNQUFNLEVBQUUsUUFBUSxFQUFFLFFBQVEsRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFDLEdBQUcsS0FBSyxDQUFDLElBQUksQ0FBQztJQUMxRSxNQUFNLElBQUksR0FBa0YsRUFBRSxDQUFDO0lBQy9GLElBQUk7UUFDRixzQkFBc0I7UUFDdEIsa0ZBQWtGO1FBQ2xGLElBQUksQ0FBQyxHQUFHLFFBQVEsQ0FBQztRQUNqQixJQUFJLENBQUMsR0FBRyxRQUFRLENBQUM7UUFDakIsSUFBSSxHQUFHLEdBQUcsQ0FBQyxDQUFDO1FBQ1osSUFBSSxJQUFJLEdBQUcsQ0FBQyxDQUFDO1FBQ2IsSUFBSSxJQUFJLEdBQUcsTUFBTSxDQUFDLFNBQVMsQ0FBQztRQUM1QixJQUFJLGdCQUFnQixDQUFDLE1BQU0sQ0FBQyxFQUFFO1lBQzVCL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iAoaiA9PT0gdmFsdWVzLmxlbmd0aCkge1xuICAgICAgICBpKys7XG4gICAgICAgIGogPSBpICsgMTtcbiAgICAgIH1cbiAgICB9XG4gICAgZGF0YS5kaXN0YW5jZU1hdHJpeERhdGEgPSByZXRWYWw7XG4gICAgZGF0YS5taW4gPSBsbWluO1xuICAgIGRhdGEubWF4ID0gbG1heDtcbiAgfSBjYXRjaCAoZSkge1xuICAgIGRhdGEuZXJyb3IgPSBlO1xuICB9XG4gIHBvc3RNZXNzYWdlKGRhdGEpO1xufTtcbiJdfQ==","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [649,361], () => (__webpack_require__(7100)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t100: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunkbio\"] = self[\"webpackChunkbio\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DistanceAggregationMethods","isNil","x","onmessage","event","values","fnName","startRow","startCol","chunckSize","opts","data","i","j","cnt","lmin","lmax","Number","MIN_VALUE","length","_data","_length","retVal","Float32Array","distanceFn","getMeasure","value","distanceMatrixData","min","max","e","error","postMessage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","__webpack_exports__","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","key","splice","r","d","definition","o","defineProperty","enumerable","get","f","chunkId","Promise","all","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","Error","replace","p","installedChunks","chunkLoadingGlobal","self","parentChunkLoadingFunction","push","bind","moreModules","runtime","pop","then"],"sourceRoot":""}
|
package/dist/118.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var bio;(()=>{"use strict";var e,r,t={7118:(e,r,t)=>{var o,n;(n=o||(o={})).EUCLIDEAN="EUCLIDEAN",n.MANHATTAN="MANHATTAN";const a=e=>null==e;var s=t(6361),i=t(9657);onmessage=async e=>{const{values:r,startIdx:t,endIdx:o,sampleLength:n,fnName:l,opts:c}=e.data;try{let e=new Float32Array(n);const p=o-t;if((0,s.sQ)(l))for(let e=0;e<r.length;++e)a(r[e])||(r[e]=new i.Z(r[e]._data,r[e]._length));let f=0;const h=Math.floor(p/n),u=new s.UH(l).getMeasure(c),g=r.length-2-Math.floor(Math.sqrt(-8*t+4*r.length*(r.length-1)-7)/2-.5),v=t-r.length*g+Math.floor((g+1)*(g+2)/2);let b=g,d=v,m=0;for(;f<p&&m<n;){const t=a(r[b])||a(r[d])?1:u(r[b],r[d]);for(e[m]=t,m++,f+=h,d+=h;d>=r.length&&f<p;)b++,d=b+1+(d-r.length)}m<n&&(e=e.slice(0,m)),postMessage({distance:e})}catch(e){postMessage({error:e})}}}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,n.x=()=>{var e=n.O(void 0,[649,361],(()=>n(7118)));return n.O(e)},e=[],n.O=(r,t,o,a)=>{if(!t){var s=1/0;for(p=0;p<e.length;p++){for(var[t,o,a]=e[p],i=!0,l=0;l<t.length;l++)(!1&a||s>=a)&&Object.keys(n.O).every((e=>n.O[e](t[l])))?t.splice(l--,1):(i=!1,a<s&&(s=a));if(i){e.splice(p--,1);var c=o();void 0!==c&&(r=c)}}return r}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[t,o,a]},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={118:1};n.f.i=(r,t)=>{e[r]||importScripts(n.p+n.u(r))};var r=self.webpackChunkbio=self.webpackChunkbio||[],t=r.push.bind(r);r.push=r=>{var[o,a,s]=r;for(var i in a)n.o(a,i)&&(n.m[i]=a[i]);for(s&&s(n);o.length;)e[o.pop()]=1;t(r)}})(),r=n.x,n.x=()=>Promise.all([n.e(649),n.e(361)]).then(r);var a=n.x();bio=a})();
|
|
2
|
-
//# sourceMappingURL=118.js.map
|