@genome-spy/app 0.73.0 → 0.74.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.
Files changed (38) hide show
  1. package/dist/AbortablePromiseCache-3gHJdF3E.js +96 -0
  2. package/dist/blosc-oa0DlI6G.js +692 -0
  3. package/dist/browser-Dvlo92rx.js +126 -0
  4. package/dist/chunk-CPXzm0be.js +11 -0
  5. package/dist/chunk-INHXZS53-fPMmEwMt.js +13 -0
  6. package/dist/esm-B8-vSu-c.js +369 -0
  7. package/dist/esm-BDFRLEuD.js +1248 -0
  8. package/dist/esm-BygJiwh0.js +573 -0
  9. package/dist/esm-CGX-qz1d.js +155 -0
  10. package/dist/esm-Cmo4qEPr.js +1015 -0
  11. package/dist/esm-CuMSzCHy.js +298 -0
  12. package/dist/esm-D-WfYOx7.js +461 -0
  13. package/dist/esm-DCCYNvaz.js +1426 -0
  14. package/dist/esm-n0auOe11.js +121 -0
  15. package/dist/index.es.js +41039 -52718
  16. package/dist/index.js +1088 -1095
  17. package/dist/lz4-jZ0zyLBa.js +626 -0
  18. package/dist/parquetRead-CJe1UPsz.js +1609 -0
  19. package/dist/schema.json +8821 -2763
  20. package/dist/style.css +2 -1
  21. package/dist/zstd-C6ksIG9r.js +583 -0
  22. package/package.json +14 -5
  23. package/dist/AbortablePromiseCache-Dj0vzLnp.js +0 -149
  24. package/dist/blosc-D1xNXZJs.js +0 -719
  25. package/dist/browser-0iNU5Wit.js +0 -138
  26. package/dist/chunk-INHXZS53-DiyuLb3Z.js +0 -14
  27. package/dist/index-BUsSzlHg.js +0 -1771
  28. package/dist/index-BYsZN7b0.js +0 -1597
  29. package/dist/index-C7wOh6y1.js +0 -657
  30. package/dist/index-CRaQAuki.js +0 -326
  31. package/dist/index-D9v1PCj9.js +0 -507
  32. package/dist/index-GDOuv_D5.js +0 -266
  33. package/dist/index-Gt44EOIH.js +0 -628
  34. package/dist/inflate-GtwLkvSP.js +0 -1048
  35. package/dist/lz4-1Ws5oVWR.js +0 -640
  36. package/dist/parquetRead-BnAGCa4_.js +0 -1663
  37. package/dist/unzip-Bac01w6X.js +0 -1492
  38. package/dist/zstd-C4EcZnjq.js +0 -603
@@ -1,326 +0,0 @@
1
- const _ = /%([0-9A-Fa-f]{2})/g, b = /^\s*##\s*(\S+)\s*(.*)/, C = /\r?\n$/, p = /\s+/, m = /\D/g;
2
- function f(n) {
3
- return n.includes("%") ? n.replaceAll(_, (e, r) => String.fromCharCode(parseInt(r, 16))) : n;
4
- }
5
- function v(n) {
6
- if (!n.length || n === ".")
7
- return {};
8
- const e = {};
9
- let r = n;
10
- r.endsWith(`
11
- `) && (r = r.slice(0, r.endsWith(`\r
12
- `) ? -2 : -1));
13
- for (const t of r.split(";")) {
14
- const i = t.indexOf("=");
15
- if (i === -1)
16
- continue;
17
- const s = t.slice(i + 1);
18
- if (!s.length)
19
- continue;
20
- const o = t.slice(0, i).trim();
21
- let c = e[o];
22
- c || (c = [], e[o] = c);
23
- for (const l of s.split(","))
24
- c.push(f(l.trim()));
25
- }
26
- return e;
27
- }
28
- function F(n) {
29
- if (!n.length || n === ".")
30
- return {};
31
- const e = {};
32
- let r = n;
33
- r.endsWith(`
34
- `) && (r = r.slice(0, r.endsWith(`\r
35
- `) ? -2 : -1));
36
- for (const t of r.split(";")) {
37
- const i = t.indexOf("=");
38
- if (i === -1)
39
- continue;
40
- const s = t.slice(i + 1);
41
- if (!s.length)
42
- continue;
43
- const o = t.slice(0, i).trim();
44
- let c = e[o];
45
- c || (c = [], e[o] = c);
46
- for (const l of s.split(","))
47
- c.push(l.trim());
48
- }
49
- return e;
50
- }
51
- function y(n) {
52
- return d(n.split(" "));
53
- }
54
- function a(n) {
55
- return n === "." || n === "" || n === void 0 ? null : n;
56
- }
57
- function d(n) {
58
- const e = a(n[0]), r = a(n[1]), t = a(n[2]), i = a(n[3]), s = a(n[4]), o = a(n[5]), c = a(n[6]), l = a(n[7]), u = a(n[8]);
59
- return {
60
- seq_id: e ? f(e) : null,
61
- source: r ? f(r) : null,
62
- type: t ? f(t) : null,
63
- start: i === null ? null : parseInt(i, 10),
64
- end: s === null ? null : parseInt(s, 10),
65
- score: o === null ? null : parseFloat(o),
66
- strand: c,
67
- phase: l,
68
- attributes: u === null ? null : v(u)
69
- };
70
- }
71
- function R(n) {
72
- const e = a(n[0]), r = a(n[1]), t = a(n[2]), i = a(n[3]), s = a(n[4]), o = a(n[5]), c = a(n[6]), l = a(n[7]), u = a(n[8]);
73
- return {
74
- seq_id: e,
75
- source: r,
76
- type: t,
77
- start: i === null ? null : parseInt(i, 10),
78
- end: s === null ? null : parseInt(s, 10),
79
- score: o === null ? null : parseFloat(o),
80
- strand: c,
81
- phase: l,
82
- attributes: u === null ? null : F(u)
83
- };
84
- }
85
- function g(n) {
86
- const e = b.exec(n);
87
- if (!e)
88
- return null;
89
- const [, r] = e;
90
- let [, , t] = e;
91
- const i = { directive: r };
92
- if (t.length && (t = t.replace(C, ""), i.value = t), r === "sequence-region") {
93
- const s = t.split(p, 3);
94
- return {
95
- ...i,
96
- seq_id: s[0],
97
- start: s[1]?.replaceAll(m, ""),
98
- end: s[2]?.replaceAll(m, "")
99
- };
100
- } else if (r === "genome-build") {
101
- const [s, o] = t.split(p, 2);
102
- return {
103
- ...i,
104
- source: s,
105
- buildName: o
106
- };
107
- }
108
- return i;
109
- }
110
- const k = /^\s*[^#\s>]/, I = /^\s*(#+)(.*)/, L = /^\s*$/, D = /^\s*>/, A = /\r?\n?$/g;
111
- class h {
112
- featureCallback;
113
- endCallback;
114
- commentCallback;
115
- errorCallback;
116
- disableDerivesFromReferences;
117
- directiveCallback;
118
- bufferSize;
119
- eof = !1;
120
- lineNumber = 0;
121
- // features that we have to keep on hand for now because they
122
- // might be referenced by something else
123
- _underConstructionTopLevel = [];
124
- // index of the above by ID
125
- _underConstructionById = {};
126
- _completedReferences = {};
127
- // features that reference something we have not seen yet
128
- // structured as:
129
- // { 'some_id' : {
130
- // 'Parent' : [ orphans that have a Parent attr referencing it ],
131
- // 'Derives_from' : [ orphans that have a Derives_from attr referencing it ],
132
- // }
133
- // }
134
- _underConstructionOrphans = {};
135
- constructor(e) {
136
- const r = () => {
137
- };
138
- this.featureCallback = e.featureCallback || r, this.endCallback = e.endCallback || r, this.commentCallback = e.commentCallback || r, this.errorCallback = e.errorCallback || r, this.directiveCallback = e.directiveCallback || r, this.disableDerivesFromReferences = e.disableDerivesFromReferences || !1, this.bufferSize = e.bufferSize === void 0 ? 1 / 0 : e.bufferSize;
139
- }
140
- addLine(e) {
141
- if (this.eof)
142
- return;
143
- if (this.lineNumber += 1, k.test(e)) {
144
- this._bufferLine(e);
145
- return;
146
- }
147
- const r = I.exec(e);
148
- if (r) {
149
- const [, t] = r;
150
- let [, , i] = r;
151
- if (t.length === 3)
152
- this._emitAllUnderConstructionFeatures();
153
- else if (t.length === 2) {
154
- const s = g(e);
155
- s && (s.directive === "FASTA" ? (this._emitAllUnderConstructionFeatures(), this.eof = !0) : this._emitItem(s));
156
- } else
157
- this._emitItem({ comment: i.trimStart() });
158
- } else if (!L.test(e)) if (D.test(e))
159
- this._emitAllUnderConstructionFeatures(), this.eof = !0;
160
- else {
161
- const t = e.replaceAll(A, "");
162
- throw new Error(`GFF3 parse error. Cannot parse '${t}'.`);
163
- }
164
- }
165
- addParsedFeatureLine(e) {
166
- this.eof || (this.lineNumber += 1, this._bufferParsedLine(e));
167
- }
168
- finish() {
169
- this._emitAllUnderConstructionFeatures(), this.endCallback();
170
- }
171
- _emitItem(e) {
172
- Array.isArray(e) ? this.featureCallback(e) : "directive" in e ? this.directiveCallback(e) : "comment" in e && this.commentCallback(e);
173
- }
174
- _enforceBufferSizeLimit(e = 0) {
175
- const r = (t) => {
176
- t && Array.isArray(t) && t[0].attributes?.ID?.[0] && (t[0].attributes.ID.forEach((s) => {
177
- delete this._underConstructionById[s], delete this._completedReferences[s];
178
- }), t.forEach((s) => {
179
- s.child_features && s.child_features.forEach((o) => {
180
- r(o);
181
- }), s.derived_features && s.derived_features.forEach((o) => {
182
- r(o);
183
- });
184
- }));
185
- };
186
- for (; this._underConstructionTopLevel.length + e > this.bufferSize; ) {
187
- const t = this._underConstructionTopLevel.shift();
188
- t && (this._emitItem(t), r(t));
189
- }
190
- }
191
- /**
192
- * return all under-construction features, called when we know
193
- * there will be no additional data to attach to them
194
- */
195
- _emitAllUnderConstructionFeatures() {
196
- this._underConstructionTopLevel.forEach(this._emitItem.bind(this)), this._underConstructionTopLevel = [], this._underConstructionById = {}, this._completedReferences = {};
197
- const e = Object.keys(this._underConstructionOrphans);
198
- if (e.length)
199
- throw new Error(`some features reference other features that do not exist in the file (or in the same '###' scope). ${e.join(",")}`);
200
- }
201
- _bufferLine(e) {
202
- this._bufferParsedLine(y(e));
203
- }
204
- _bufferParsedLine(e) {
205
- const r = e;
206
- r.child_features = [], r.derived_features = [];
207
- const t = r.attributes?.ID || [], i = r.attributes?.Parent || [], s = this.disableDerivesFromReferences ? [] : r.attributes?.Derives_from || [];
208
- if (!t.length && !i.length && !s.length) {
209
- this._emitItem([r]);
210
- return;
211
- }
212
- let o;
213
- t.forEach((c) => {
214
- const l = this._underConstructionById[c];
215
- l ? (l[l.length - 1].type !== r.type && this._parseError(`multi-line feature "${c}" has inconsistent types: "${r.type}", "${l[l.length - 1].type}"`), l.push(r), o = l) : (o = [r], this._enforceBufferSizeLimit(1), !i.length && !s.length && this._underConstructionTopLevel.push(o), this._underConstructionById[c] = o, this._resolveReferencesTo(o, c));
216
- }), this._resolveReferencesFrom(
217
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
218
- o || [r],
219
- { Parent: i, Derives_from: s },
220
- t
221
- );
222
- }
223
- _resolveReferencesTo(e, r) {
224
- const t = this._underConstructionOrphans[r];
225
- if (t) {
226
- for (const i of e)
227
- i.child_features.push(...t.Parent), i.derived_features.push(...t.Derives_from);
228
- delete this._underConstructionOrphans[r];
229
- }
230
- }
231
- _parseError(e) {
232
- this.eof = !0, this.errorCallback(`${this.lineNumber}: ${e}`);
233
- }
234
- _resolveReferencesFrom(e, r, t) {
235
- for (const i of r.Parent) {
236
- const s = this._underConstructionById[i];
237
- if (s) {
238
- let o = !1;
239
- for (const c of t) {
240
- const l = `Parent,${i}`, u = this._completedReferences[c] || (this._completedReferences[c] = {});
241
- u[l] && (o = !0), u[l] = !0;
242
- }
243
- if (!o)
244
- for (const c of s)
245
- c.child_features.push(e);
246
- } else {
247
- let o = this._underConstructionOrphans[i];
248
- o || (o = { Parent: [], Derives_from: [] }, this._underConstructionOrphans[i] = o), o.Parent.push(e);
249
- }
250
- }
251
- for (const i of r.Derives_from) {
252
- const s = this._underConstructionById[i];
253
- if (s) {
254
- let o = !1;
255
- for (const c of t) {
256
- const l = `Derives_from,${i}`, u = this._completedReferences[c] || (this._completedReferences[c] = {});
257
- u[l] && (o = !0), u[l] = !0;
258
- }
259
- if (!o)
260
- for (const c of s)
261
- c.derived_features.push(e);
262
- } else {
263
- let o = this._underConstructionOrphans[i];
264
- o || (o = { Parent: [], Derives_from: [] }, this._underConstructionOrphans[i] = o), o.Derives_from.push(e);
265
- }
266
- }
267
- }
268
- }
269
- function x(n) {
270
- const e = [], r = new h({
271
- featureCallback: (t) => e.push(t),
272
- disableDerivesFromReferences: !0,
273
- errorCallback: (t) => {
274
- throw new Error(t);
275
- }
276
- });
277
- for (const t of n.split(/\r?\n/))
278
- r.addLine(t);
279
- return r.finish(), e;
280
- }
281
- function w(n) {
282
- const e = [], r = new h({
283
- featureCallback: (t) => e.push(t),
284
- disableDerivesFromReferences: !0,
285
- errorCallback: (t) => {
286
- throw new Error(t);
287
- }
288
- });
289
- for (const t of n)
290
- r.addLine(t);
291
- return r.finish(), e;
292
- }
293
- function S(n) {
294
- const e = [], r = new h({
295
- featureCallback: (t) => e.push(t),
296
- disableDerivesFromReferences: !0,
297
- errorCallback: (t) => {
298
- throw new Error(t);
299
- }
300
- });
301
- for (const t of n) {
302
- const i = d(t.fields);
303
- t.lineHash !== void 0 && (i.attributes || (i.attributes = {}), i.attributes._lineHash = [String(t.lineHash)]), r.addParsedFeatureLine(i);
304
- }
305
- return r.finish(), e;
306
- }
307
- function E(n, e) {
308
- const r = [], t = new h({
309
- featureCallback: (s) => r.push(s),
310
- disableDerivesFromReferences: !0,
311
- errorCallback: (s) => {
312
- throw new Error(s);
313
- }
314
- }), i = e ? d : R;
315
- for (const s of n) {
316
- const o = i(s.fields);
317
- s.lineHash !== void 0 && (o.attributes || (o.attributes = {}), o.attributes._lineHash = [String(s.lineHash)]), t.addParsedFeatureLine(o);
318
- }
319
- return t.finish(), r;
320
- }
321
- export {
322
- w as parseArraySync,
323
- S as parseRecordsSync,
324
- E as parseRecordsSyncFast,
325
- x as parseStringSync
326
- };