@genome-spy/app 1.2.0 → 1.3.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/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
- package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
- package/dist/{agentApi-8hMSlqAQ.js → agentApi-BclFF9zB.js} +7130 -7509
- package/dist/agentApi.es.js +4344 -4015
- package/dist/agentShared.es.js +431 -458
- package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
- package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
- package/dist/{canvas2d-Bd8H8MMo.js → canvas2d-8MSf70d4.js} +78 -86
- package/dist/{canvas2d-D6VYooRf.js → canvas2d-BwGNI_Rx.js} +83 -91
- package/dist/clipOptions-SrrxeAEU.js +4316 -0
- package/dist/clipOptions-clBEbkjv.js +4326 -0
- package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
- package/dist/color-uTRRsy8i.js +116 -0
- package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
- package/dist/{containerView-aEVmYmkA.js → containerView-BItRtKqu.js} +5 -1
- package/dist/{containerView-CRJSc4bM.js → containerView-CWa6ZIJW.js} +5 -1
- package/dist/{debug-CQ0agCrd.js → debug-23s-jja_.js} +3 -2
- package/dist/{debug-DkIMiGdW.js → debug-CWRxvAss.js} +2 -3
- package/dist/dialog.es.js +1 -1
- package/dist/dist-CmY6iewb.js +1501 -0
- package/dist/dist-D6xbz5Ks.js +1501 -0
- package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
- package/dist/esm-BUkWqSr2.js +299 -0
- package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
- package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
- package/dist/esm-C6erfjPM.js +252 -0
- package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
- package/dist/esm-CqY5ezGz.js +1249 -0
- package/dist/esm-DfMIJ_N2.js +1522 -0
- package/dist/esm-Dls41IbZ.js +787 -0
- package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
- package/dist/esm-aGLCvYRP.js +238 -0
- package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
- package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
- package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
- package/dist/flowNode-BSjy0Wz3.js +1306 -0
- package/dist/flowOutput-D5qpxWe0.js +183 -0
- package/dist/index.es.js +4756 -5528
- package/dist/index.js +707 -547
- package/dist/inflate-BdC5KvHn.js +886 -0
- package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
- package/dist/{markUtils-CvLDz744.js → markUtils-RaatLEa-.js} +9 -6
- package/dist/metadataUtils-DxEPe0vj.js +879 -0
- package/dist/{order-BVvkjDRT.js → order-BnKzKjt4.js} +383 -347
- package/dist/{order-DmMoZsi1.js → order-BpJnq_nV.js} +375 -339
- package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
- package/dist/{rasterExport-jeRVq6kY.js → rasterExport-B-WrX1pa.js} +5 -5
- package/dist/{rasterExport-DxvowWjH.js → rasterExport-C_vx4Jwd.js} +3 -3
- package/dist/{rasterization-DFj3Cvx4.js → rasterization-QktH8Sn2.js} +1 -1
- package/dist/{rectangle-Dl4Dy0hS.js → rectangle-BAdoDPXu.js} +34 -31
- package/dist/{renderCanvas2D-Bfm1NHFu.js → renderCanvas2D-CsRO78Pq.js} +88 -87
- package/dist/{renderCanvas2D-DVjhp834.js → renderCanvas2D-Y7pkRzbC.js} +93 -92
- package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
- package/dist/{indexer-DOYMJ-Md.js → scaleNull-CVzag4z8.js} +2 -12
- package/dist/{indexer-DDC0YRGn.js → scaleNull-Pbz7QGnl.js} +2 -12
- package/dist/{scalePosition-0aeqp_kz.js → scalePosition-CRXa0rCC.js} +1 -1
- package/dist/schema.json +3801 -816
- package/dist/{svg-Bm2zxBPu.js → svg-BBMtLgtM.js} +369 -285
- package/dist/{svg-CkfuhONt.js → svg-JjWL6U-T.js} +371 -287
- package/dist/{svgRasterizer-DoRQEqFA.js → svgRasterizer-6OcftuoI.js} +2 -2
- package/dist/{svgRasterizer-raDDhBF-.js → svgRasterizer-DkNRaCPs.js} +4 -4
- package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
- package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
- package/dist/url-DeOdSRrv.js +183 -0
- package/dist/{viewError-BkJeVYXA.js → viewError-B0TMfOpB.js} +1 -1
- package/dist/{viewError-IYqyluc7.js → viewError-D9aO90cI.js} +1 -1
- package/dist/{viewSelectors-7LyasQN-.js → viewSelectors-DkFvo33d.js} +832 -734
- package/dist/{viewSelectors-CbmkSQRT.js → viewSelectors-lM93fHAq.js} +900 -802
- package/dist/{viewUtils-DuddMNNw.js → viewUtils-0SJOewM6.js} +1861 -2459
- package/dist/webgl-CXIO3OQz.js +5782 -0
- package/dist/webgl-Pdvfhio5.js +5783 -0
- package/package.json +7 -5
- package/src/agentApi/index.d.ts +3 -2
- package/src/agentShared/index.d.ts +2 -0
- package/src/appTypes.d.ts +1 -6
- package/src/embedTypes.d.ts +36 -1
- package/src/index.d.ts +6 -0
- package/src/spec/sampleView.d.ts +68 -13
- package/src/state/paramProvenanceTypes.d.ts +25 -2
- package/src/state.d.ts +14 -52
- package/dist/clipOptions-DElJ8dTZ.js +0 -3097
- package/dist/clipOptions-D_wBNhzs.js +0 -3087
- package/dist/esm-Dndm-NaA.js +0 -1193
- package/dist/vega-scale-BoGHANI7.js +0 -2446
- package/dist/vega-scale-o9TRyzYH.js +0 -2443
- package/dist/webgl-CQfvgnxo.js +0 -5633
- package/dist/webgl-DVYkXtiZ.js +0 -5632
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-DeIk2rA4.js";
|
|
2
|
+
import { t } from "./__vite-browser-external-Dgu_Ldik.js";
|
|
3
|
+
//#region ../../node_modules/generic-filehandle2/esm/util.js
|
|
4
|
+
async function n(e) {
|
|
5
|
+
return e.bytes ? e.bytes() : new Uint8Array(await e.arrayBuffer());
|
|
6
|
+
}
|
|
7
|
+
async function r(e, t, r) {
|
|
8
|
+
if (t === "utf8" || t === "utf-8") return e.text();
|
|
9
|
+
if (t) throw Error(`unsupported encoding: ${t}`);
|
|
10
|
+
return r && "body" in e ? c(e, r) : n(e);
|
|
11
|
+
}
|
|
12
|
+
function i(e) {
|
|
13
|
+
return typeof e == "string" ? {
|
|
14
|
+
encoding: e,
|
|
15
|
+
opts: {}
|
|
16
|
+
} : {
|
|
17
|
+
encoding: e?.encoding,
|
|
18
|
+
opts: e ?? {}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function a(e) {
|
|
22
|
+
let t = /\/(\d+)$/.exec(e ?? "")?.[1];
|
|
23
|
+
return t === void 0 ? void 0 : parseInt(t, 10);
|
|
24
|
+
}
|
|
25
|
+
function o(e) {
|
|
26
|
+
let t = e.headers.get("content-length"), n = t === null ? NaN : Number(t);
|
|
27
|
+
return Number.isSafeInteger(n) && n >= 0 ? n : void 0;
|
|
28
|
+
}
|
|
29
|
+
var s = 50;
|
|
30
|
+
async function c(e, t) {
|
|
31
|
+
let r = o(e), i = e.body;
|
|
32
|
+
if (!i || r === void 0) {
|
|
33
|
+
let i = await n(e);
|
|
34
|
+
return t(i.byteLength, r ?? i.byteLength), i;
|
|
35
|
+
}
|
|
36
|
+
let a = i.getReader(), c = new Uint8Array(r), l = 0, u = Date.now();
|
|
37
|
+
t(0, r);
|
|
38
|
+
for (let e = await a.read(); !e.done; e = await a.read()) {
|
|
39
|
+
if (l + e.value.byteLength > c.length) {
|
|
40
|
+
let t = new Uint8Array(Math.max(l + e.value.byteLength, c.length * 2));
|
|
41
|
+
t.set(c.subarray(0, l)), c = t;
|
|
42
|
+
}
|
|
43
|
+
c.set(e.value, l), l += e.value.byteLength;
|
|
44
|
+
let n = Date.now();
|
|
45
|
+
n - u >= s && (u = n, t(l, r));
|
|
46
|
+
}
|
|
47
|
+
return t(l, r), l === c.length ? c : c.slice(0, l);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region ../../node_modules/generic-filehandle2/esm/blobFile.js
|
|
51
|
+
var l = class {
|
|
52
|
+
source;
|
|
53
|
+
blob;
|
|
54
|
+
constructor(e) {
|
|
55
|
+
this.blob = e;
|
|
56
|
+
}
|
|
57
|
+
async read(e, t = 0, r = {}) {
|
|
58
|
+
if (e === 0) return /* @__PURE__ */ new Uint8Array();
|
|
59
|
+
r.signal?.throwIfAborted();
|
|
60
|
+
let i = await n(this.blob.slice(t, t + e));
|
|
61
|
+
return r.signal?.throwIfAborted(), i;
|
|
62
|
+
}
|
|
63
|
+
async readFile(e) {
|
|
64
|
+
let { encoding: t, opts: n } = i(e);
|
|
65
|
+
n.signal?.throwIfAborted();
|
|
66
|
+
let a = await r(this.blob, t);
|
|
67
|
+
return n.signal?.throwIfAborted(), a;
|
|
68
|
+
}
|
|
69
|
+
stat() {
|
|
70
|
+
return Promise.resolve({ size: this.blob.size });
|
|
71
|
+
}
|
|
72
|
+
close() {
|
|
73
|
+
return Promise.resolve();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region ../../node_modules/generic-filehandle2/esm/remoteFile.js
|
|
78
|
+
function u(...e) {
|
|
79
|
+
let t = /* @__PURE__ */ new Map();
|
|
80
|
+
for (let n of e) for (let [e, r] of Object.entries(n ?? {})) t.set(e.toLowerCase(), [e, r]);
|
|
81
|
+
return Object.fromEntries(t.values());
|
|
82
|
+
}
|
|
83
|
+
function d(e) {
|
|
84
|
+
let t = e.body;
|
|
85
|
+
typeof t?.cancel == "function" && t.cancel().catch(() => void 0);
|
|
86
|
+
}
|
|
87
|
+
function f(e) {
|
|
88
|
+
return Number.isSafeInteger(e) && e >= 0;
|
|
89
|
+
}
|
|
90
|
+
function p(e) {
|
|
91
|
+
return typeof e == "object" && !!e && "name" in e && e.name === "TypeError";
|
|
92
|
+
}
|
|
93
|
+
function m(e) {
|
|
94
|
+
return (typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : `${e}`).replace(/\.$/, "");
|
|
95
|
+
}
|
|
96
|
+
var h = class {
|
|
97
|
+
url;
|
|
98
|
+
get source() {
|
|
99
|
+
return this.url;
|
|
100
|
+
}
|
|
101
|
+
_stat;
|
|
102
|
+
statProbe;
|
|
103
|
+
fetchImplementation;
|
|
104
|
+
baseHeaders;
|
|
105
|
+
baseOverrides;
|
|
106
|
+
baseSignal;
|
|
107
|
+
constructor(e, t = {}) {
|
|
108
|
+
this.url = e, this.baseHeaders = t.headers ?? {}, this.baseOverrides = t.overrides ?? {}, this.baseSignal = t.signal, this.fetchImplementation = t.fetch ?? globalThis.fetch.bind(globalThis);
|
|
109
|
+
}
|
|
110
|
+
buildRequest(e, t) {
|
|
111
|
+
let n = e.signal ?? this.baseSignal;
|
|
112
|
+
return {
|
|
113
|
+
method: "GET",
|
|
114
|
+
redirect: "follow",
|
|
115
|
+
mode: "cors",
|
|
116
|
+
...this.baseOverrides,
|
|
117
|
+
...e.overrides,
|
|
118
|
+
headers: u(this.baseHeaders, e.headers, t),
|
|
119
|
+
...n ? { signal: n } : {}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
async fetch(e, t) {
|
|
123
|
+
let n = (n) => p(n) && !t?.signal?.aborted ? Error(`${m(n)} fetching ${e}`, { cause: n }) : n, r;
|
|
124
|
+
try {
|
|
125
|
+
r = await this.fetchImplementation(e, t);
|
|
126
|
+
} catch (i) {
|
|
127
|
+
if (`${i}`.includes("Failed to fetch")) {
|
|
128
|
+
console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
|
|
129
|
+
try {
|
|
130
|
+
r = await this.fetchImplementation(e, {
|
|
131
|
+
...t,
|
|
132
|
+
cache: "reload"
|
|
133
|
+
});
|
|
134
|
+
} catch (e) {
|
|
135
|
+
throw n(e);
|
|
136
|
+
}
|
|
137
|
+
} else throw n(i);
|
|
138
|
+
}
|
|
139
|
+
return r;
|
|
140
|
+
}
|
|
141
|
+
async read(e, t, n = {}) {
|
|
142
|
+
if (!f(e) || !f(t)) throw TypeError(`read() called with an invalid length or position (length=${e}, position=${t}). The index file may be corrupt.`);
|
|
143
|
+
return e === 0 ? /* @__PURE__ */ new Uint8Array() : this.fetchBytes(e, t, n);
|
|
144
|
+
}
|
|
145
|
+
async fetchBytes(e, t, r) {
|
|
146
|
+
let i = await this.fetch(this.url, this.buildRequest(r, { range: `bytes=${t}-${t + e - 1}` }));
|
|
147
|
+
if (i.status === 416) return d(i), /* @__PURE__ */ new Uint8Array();
|
|
148
|
+
if (this.checkOk(i), i.status === 200 && t === 0 || i.status === 206) {
|
|
149
|
+
let t = a(i.headers.get("content-range"));
|
|
150
|
+
t !== void 0 && (this._stat = { size: t });
|
|
151
|
+
let o = r.onProgress ? await c(i, r.onProgress) : await n(i);
|
|
152
|
+
return !this._stat && i.status === 200 && (this._stat = { size: o.byteLength }), o.byteLength <= e ? o : o.slice(0, e);
|
|
153
|
+
}
|
|
154
|
+
throw d(i), Error(i.status === 200 ? `${this.url} fetch returned status 200, expected 206` : `HTTP ${i.status} fetching ${this.url}`);
|
|
155
|
+
}
|
|
156
|
+
checkOk(e) {
|
|
157
|
+
if (!e.ok) throw d(e), Error(`HTTP ${e.status} fetching ${this.url}`);
|
|
158
|
+
}
|
|
159
|
+
async readFile(e) {
|
|
160
|
+
let { encoding: t, opts: n } = i(e), r = await this.fetch(this.url, this.buildRequest(n));
|
|
161
|
+
this.checkOk(r);
|
|
162
|
+
let a = await this.readFileBody(r, t, n.onProgress);
|
|
163
|
+
return r.status === 200 && typeof a != "string" && (this._stat = { size: a.byteLength }), a;
|
|
164
|
+
}
|
|
165
|
+
readFileBody(e, t, n) {
|
|
166
|
+
return r(e, t, n);
|
|
167
|
+
}
|
|
168
|
+
async stat() {
|
|
169
|
+
return this._stat || (this.statProbe ??= this.read(10, 0).finally(() => {
|
|
170
|
+
this.statProbe = void 0;
|
|
171
|
+
}), await this.statProbe), this._stat ?? { size: 0 };
|
|
172
|
+
}
|
|
173
|
+
close() {
|
|
174
|
+
return Promise.resolve();
|
|
175
|
+
}
|
|
176
|
+
}, g = t();
|
|
177
|
+
function _(e) {
|
|
178
|
+
return typeof e == "object" && !!e && "unref" in e && typeof e.unref == "function";
|
|
179
|
+
}
|
|
180
|
+
var v = class {
|
|
181
|
+
filename;
|
|
182
|
+
get source() {
|
|
183
|
+
return this.filename;
|
|
184
|
+
}
|
|
185
|
+
cacheFd;
|
|
186
|
+
fdIdleTimeoutMs;
|
|
187
|
+
fh;
|
|
188
|
+
opening;
|
|
189
|
+
idleTimer;
|
|
190
|
+
constructor(e, t = {}) {
|
|
191
|
+
this.filename = e, this.cacheFd = t.cacheFd ?? !0, this.fdIdleTimeoutMs = t.fdIdleTimeoutMs ?? 3e4;
|
|
192
|
+
}
|
|
193
|
+
touch() {
|
|
194
|
+
this.fdIdleTimeoutMs <= 0 || (this.idleTimer !== void 0 && clearTimeout(this.idleTimer), this.idleTimer = setTimeout(() => {
|
|
195
|
+
this.idleTimer = void 0, this.dropHandle();
|
|
196
|
+
}, this.fdIdleTimeoutMs), _(this.idleTimer) && this.idleTimer.unref());
|
|
197
|
+
}
|
|
198
|
+
async handle() {
|
|
199
|
+
return this.fh ? this.fh : (this.opening ??= (0, g.open)(this.filename, "r").then((e) => (this.fh = e, this.opening = void 0, e), (e) => {
|
|
200
|
+
throw this.opening = void 0, e;
|
|
201
|
+
}), this.opening);
|
|
202
|
+
}
|
|
203
|
+
async dropHandle() {
|
|
204
|
+
this.idleTimer !== void 0 && (clearTimeout(this.idleTimer), this.idleTimer = void 0);
|
|
205
|
+
let e = this.fh ?? await this.opening?.catch(() => void 0);
|
|
206
|
+
if (this.fh = void 0, e) try {
|
|
207
|
+
await e.close();
|
|
208
|
+
} catch {}
|
|
209
|
+
}
|
|
210
|
+
async read(e, t = 0, n = {}) {
|
|
211
|
+
if (e === 0) return /* @__PURE__ */ new Uint8Array();
|
|
212
|
+
if (n.signal?.throwIfAborted(), !this.cacheFd) return this.readWithOwnHandle(e, t, n);
|
|
213
|
+
for (let r = 0;; r++) {
|
|
214
|
+
let i = await this.handle();
|
|
215
|
+
try {
|
|
216
|
+
let r = await this.readFrom(i, e, t, n);
|
|
217
|
+
return this.touch(), r;
|
|
218
|
+
} catch (e) {
|
|
219
|
+
if (await this.dropHandle(), r > 0 || n.signal?.aborted) throw e;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async readFrom(e, t, n, r) {
|
|
224
|
+
let i = new Uint8Array(t), a = await e.read(i, 0, t, n);
|
|
225
|
+
return r.signal?.throwIfAborted(), a.buffer.subarray(0, a.bytesRead);
|
|
226
|
+
}
|
|
227
|
+
async readWithOwnHandle(e, t, n) {
|
|
228
|
+
let r;
|
|
229
|
+
try {
|
|
230
|
+
return r = await (0, g.open)(this.filename, "r"), await this.readFrom(r, e, t, n);
|
|
231
|
+
} finally {
|
|
232
|
+
if (r) try {
|
|
233
|
+
await r.close();
|
|
234
|
+
} catch {}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
async readFile(e) {
|
|
238
|
+
return (0, g.readFile)(this.filename, e);
|
|
239
|
+
}
|
|
240
|
+
async stat() {
|
|
241
|
+
return (0, g.stat)(this.filename);
|
|
242
|
+
}
|
|
243
|
+
async close() {
|
|
244
|
+
await this.dropHandle();
|
|
245
|
+
}
|
|
246
|
+
}, y = /* @__PURE__ */ e({
|
|
247
|
+
BlobFile: () => l,
|
|
248
|
+
LocalFile: () => v,
|
|
249
|
+
RemoteFile: () => h
|
|
250
|
+
});
|
|
251
|
+
//#endregion
|
|
252
|
+
export { v as n, h as r, y as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as r, r as i } from "./esm-
|
|
1
|
+
import { n as e, r as t } from "./esm-nzwgJFGz.js";
|
|
2
|
+
import { t as n } from "./esm-C3A-AuRi.js";
|
|
3
|
+
import { n as r, r as i } from "./esm-BUkWqSr2.js";
|
|
4
4
|
//#region ../../node_modules/@gmod/bam/esm/chunk.js
|
|
5
5
|
var a = class {
|
|
6
6
|
minv;
|
|
@@ -68,11 +68,7 @@ function u(e) {
|
|
|
68
68
|
let t = [e[0]];
|
|
69
69
|
for (let n = 1; n < e.length; n++) {
|
|
70
70
|
let r = e[n], i = t[t.length - 1].maxv;
|
|
71
|
-
|
|
72
|
-
t.push(r);
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
(r.maxv.blockPosition - i.blockPosition || r.maxv.dataPosition - i.dataPosition) > 0 && t.push(new a(i, r.maxv, r.bin, r.endPosition));
|
|
71
|
+
(r.minv.blockPosition - i.blockPosition || r.minv.dataPosition - i.dataPosition) >= 0 ? t.push(r) : (r.maxv.blockPosition - i.blockPosition || r.maxv.dataPosition - i.dataPosition) > 0 && t.push(new a(i, r.maxv, r.bin, r.endPosition));
|
|
76
72
|
}
|
|
77
73
|
return t;
|
|
78
74
|
}
|
|
@@ -158,13 +154,13 @@ function v(e, t, n, r, i = []) {
|
|
|
158
154
|
}
|
|
159
155
|
//#endregion
|
|
160
156
|
//#region ../../node_modules/@gmod/bam/esm/indexFile.js
|
|
161
|
-
function y(
|
|
162
|
-
let r = new
|
|
163
|
-
return (
|
|
164
|
-
let n = r.get(
|
|
157
|
+
function y(e, t = 5) {
|
|
158
|
+
let r = new n({ maxSize: t });
|
|
159
|
+
return (t) => {
|
|
160
|
+
let n = r.get(t);
|
|
165
161
|
if (n !== void 0) return n;
|
|
166
|
-
let i = t
|
|
167
|
-
return i && r.set(
|
|
162
|
+
let i = e(t);
|
|
163
|
+
return i && r.set(t, i), i;
|
|
168
164
|
};
|
|
169
165
|
}
|
|
170
166
|
var b = class {
|
|
@@ -628,10 +624,10 @@ var k = class extends b {
|
|
|
628
624
|
};
|
|
629
625
|
}
|
|
630
626
|
async _parse(e) {
|
|
631
|
-
let
|
|
627
|
+
let t = await this.filehandle.readFile(e), n = await r(t), i = new DataView(n.buffer, n.byteOffset, n.byteLength), o = i.getUint32(0, !0);
|
|
632
628
|
if (o !== ae && o !== oe) throw Error(`Not a CSI file ${o}`);
|
|
633
629
|
this.minShift = i.getInt32(4, !0), this.depth = i.getInt32(8, !0), this.maxBinNumber = ((1 << (this.depth + 1) * 3) - 1) / 7;
|
|
634
|
-
let c = this.maxBinNumber, l = i.getInt32(12, !0), u = l >= 30 ? this.parseAuxData(
|
|
630
|
+
let c = this.maxBinNumber, l = i.getInt32(12, !0), u = l >= 30 ? this.parseAuxData(n, 16) : void 0, p = i.getInt32(16 + l, !0), h = 16 + l + 4, g, _ = [];
|
|
635
631
|
for (let e = 0; e < p; e++) {
|
|
636
632
|
_.push(h);
|
|
637
633
|
let e = i.getInt32(h, !0);
|
|
@@ -640,7 +636,7 @@ var k = class extends b {
|
|
|
640
636
|
let e = i.getUint32(h, !0);
|
|
641
637
|
if (h += 4, e > this.maxBinNumber) h += 44;
|
|
642
638
|
else {
|
|
643
|
-
g = m(
|
|
639
|
+
g = m(n, h, 1, g), h += 8;
|
|
644
640
|
let e = i.getInt32(h, !0);
|
|
645
641
|
h += 4 + 16 * e;
|
|
646
642
|
}
|
|
@@ -649,22 +645,22 @@ var k = class extends b {
|
|
|
649
645
|
function v(e) {
|
|
650
646
|
let t = _[e];
|
|
651
647
|
if (t === void 0) return;
|
|
652
|
-
let
|
|
648
|
+
let r = i.getInt32(t, !0);
|
|
653
649
|
t += 4;
|
|
654
650
|
let o = {}, l;
|
|
655
|
-
for (let e = 0; e <
|
|
651
|
+
for (let e = 0; e < r; e++) {
|
|
656
652
|
let e = i.getUint32(t, !0);
|
|
657
|
-
if (t += 4, e > c) l = d(
|
|
653
|
+
if (t += 4, e > c) l = d(n, t + 28), t += 44;
|
|
658
654
|
else {
|
|
659
655
|
t += 8;
|
|
660
|
-
let
|
|
656
|
+
let r = i.getInt32(t, !0);
|
|
661
657
|
t += 4;
|
|
662
|
-
let c = Array(
|
|
663
|
-
for (let i = 0; i <
|
|
664
|
-
let
|
|
658
|
+
let c = Array(r);
|
|
659
|
+
for (let i = 0; i < r; i += 1) {
|
|
660
|
+
let r = s(n, t);
|
|
665
661
|
t += 8;
|
|
666
|
-
let o = s(
|
|
667
|
-
t += 8, c[i] = new a(
|
|
662
|
+
let o = s(n, t);
|
|
663
|
+
t += 8, c[i] = new a(r, o, e);
|
|
668
664
|
}
|
|
669
665
|
o[e] = c;
|
|
670
666
|
}
|
|
@@ -1190,8 +1186,8 @@ function ye(e) {
|
|
|
1190
1186
|
return n;
|
|
1191
1187
|
}
|
|
1192
1188
|
var K = 65536, be = 33554432;
|
|
1193
|
-
function q(
|
|
1194
|
-
return
|
|
1189
|
+
function q(n, r, i) {
|
|
1190
|
+
return n ?? (r ? new e(r) : i ? new t(i) : void 0);
|
|
1195
1191
|
}
|
|
1196
1192
|
function J(e, t, n) {
|
|
1197
1193
|
let r = e?.[0];
|
|
@@ -1266,11 +1262,11 @@ var X = 104857600, Z = 6, xe = class {
|
|
|
1266
1262
|
}
|
|
1267
1263
|
async getHeaderPre(e = {}) {
|
|
1268
1264
|
if (!this.index) throw Error("no index to read a header from: use HtsgetFile for htsget sources");
|
|
1269
|
-
let
|
|
1265
|
+
let t = await this.index.parse(e), n = t.firstDataLine === void 0 ? K : t.firstDataLine.blockPosition + K, i, a;
|
|
1270
1266
|
do {
|
|
1271
|
-
let
|
|
1272
|
-
a =
|
|
1273
|
-
} while (i === void 0 && !a &&
|
|
1267
|
+
let t = await this.bam.read(n, 0, { signal: e.signal });
|
|
1268
|
+
a = t.length < n, i = this.applyHeader(await r(t)), n *= 2;
|
|
1269
|
+
} while (i === void 0 && !a && n <= be);
|
|
1274
1270
|
if (i === void 0) throw Error("Insufficient data for reference sequences");
|
|
1275
1271
|
return i;
|
|
1276
1272
|
}
|
|
@@ -1406,12 +1402,12 @@ var X = 104857600, Z = 6, xe = class {
|
|
|
1406
1402
|
return await Promise.all(Array.from({ length: m }, () => p())), d.flat();
|
|
1407
1403
|
}
|
|
1408
1404
|
async _readChunkFeatures(e, t) {
|
|
1409
|
-
let
|
|
1405
|
+
let n = await this.bam.read(e.fetchedSize(), e.minv.blockPosition, { signal: t.signal });
|
|
1410
1406
|
c(t.signal);
|
|
1411
|
-
let { buffer:
|
|
1407
|
+
let { buffer: r, cpositions: a, dpositions: o } = await i(n, e);
|
|
1412
1408
|
return {
|
|
1413
|
-
features: this.readBamFeatures(
|
|
1414
|
-
bytes:
|
|
1409
|
+
features: this.readBamFeatures(r, a, o, e),
|
|
1410
|
+
bytes: r.byteLength
|
|
1415
1411
|
};
|
|
1416
1412
|
}
|
|
1417
1413
|
readBamFeatures(e, t, n, r) {
|
|
@@ -1492,8 +1488,8 @@ async function we(e, { url: t, headers: n }, r) {
|
|
|
1492
1488
|
});
|
|
1493
1489
|
return new Uint8Array(await o.arrayBuffer());
|
|
1494
1490
|
}
|
|
1495
|
-
async function Te(e,
|
|
1496
|
-
return g(await Promise.all(
|
|
1491
|
+
async function Te(e, t, n) {
|
|
1492
|
+
return g(await Promise.all(t.map(async (t) => r(await we(e, t, n)))));
|
|
1497
1493
|
}
|
|
1498
1494
|
var Ee = class extends Q {
|
|
1499
1495
|
baseUrl;
|