@genome-spy/app 1.0.0 → 1.1.1

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 (39) hide show
  1. package/dist/SharedReadCache-Ey5QIiPM.js +207 -0
  2. package/dist/{agentApi-Z65dw-sD.js → agentApi-sPuuT0KS.js} +3573 -3485
  3. package/dist/agentApi.es.js +1550 -1461
  4. package/dist/agentShared.es.js +2 -2
  5. package/dist/{canvas2d-t_N10CeW.js → canvas2d-MXaFeZnP.js} +4 -4
  6. package/dist/{canvas2d-DiPQvNtZ.js → canvas2d-iDK4BC5j.js} +4 -4
  7. package/dist/{debug-CVAlrcZt.js → debug-BlqDxTw3.js} +2 -2
  8. package/dist/{debug-DP4WzTNo.js → debug-DbigmdrK.js} +2 -2
  9. package/dist/esm-C-6g-SkZ.js +791 -0
  10. package/dist/{esm-L53qjcYH.js → esm-CJeszW-t.js} +344 -250
  11. package/dist/esm-CjkeZi__.js +238 -0
  12. package/dist/index.es.js +2896 -2896
  13. package/dist/index.js +303 -304
  14. package/dist/{order-R043xTpC.js → order-B4uR9Q04.js} +1 -1
  15. package/dist/{order-BkYCnwD7.js → order-BSPy5DI8.js} +1 -1
  16. package/dist/{rasterExport-C_FcNBkC.js → rasterExport-B62RmAK1.js} +3 -3
  17. package/dist/{rasterExport-Z7gs5346.js → rasterExport-DQH3hVg_.js} +3 -3
  18. package/dist/{rasterization-_-9JmSas.js → rasterization-B05bDo5e.js} +15 -18
  19. package/dist/rasterization-CFogVB3B.js +50 -0
  20. package/dist/{renderCanvas2D-IM-A9DYG.js → renderCanvas2D-Bdv-B4wj.js} +15 -15
  21. package/dist/{renderCanvas2D-DK1c9TFK.js → renderCanvas2D-ChdoHGrU.js} +15 -15
  22. package/dist/scalePosition-ByvlXaML.js +11 -0
  23. package/dist/schema.json +7 -0
  24. package/dist/{svg-PabUdcDi.js → svg-DHsq1RpV.js} +13 -13
  25. package/dist/{svg-DW3tfUmm.js → svg-N3tj05-e.js} +13 -13
  26. package/dist/{svgRasterizer-B6YtWLJs.js → svgRasterizer-CYVDlt5z.js} +2 -2
  27. package/dist/{svgRasterizer-BEVDyyS3.js → svgRasterizer-CvCBlxLj.js} +2 -2
  28. package/dist/{viewIdentityRegistry-BW415b3o.js → viewIdentityRegistry-BDKkEjXl.js} +1 -1
  29. package/dist/{viewIdentityRegistry-_F0E7nkA.js → viewIdentityRegistry-BIYd4TE0.js} +1 -1
  30. package/dist/{viewSelectors-KtD-QSN0.js → viewSelectors-DDLW-byr.js} +80 -50
  31. package/dist/{viewSelectors-DYz-PhTO.js → viewSelectors-j-F9XwsE.js} +80 -50
  32. package/dist/{viewUtils-BZGPseMx.js → viewUtils-JX6CMEYH.js} +1212 -1211
  33. package/dist/{webgl-BKSGqHaz.js → webgl-DdmOwEH0.js} +107 -86
  34. package/dist/{webgl-tdKf9SlZ.js → webgl-Dw8xqZpX.js} +107 -86
  35. package/package.json +7 -9
  36. package/LICENSE +0 -21
  37. package/dist/AbortablePromiseCache-BTmAcN-t.js +0 -96
  38. package/dist/esm-BiqrFjMh.js +0 -443
  39. package/dist/esm-DtNElqRr.js +0 -462
@@ -1,462 +0,0 @@
1
- import { t as e } from "./esm-C3A-AuRi.js";
2
- import { n as t, r as n } from "./esm-Dndm-NaA.js";
3
- import { n as r, r as i } from "./esm-VFJeyk9i.js";
4
- import { t as a } from "./AbortablePromiseCache-BTmAcN-t.js";
5
- //#region ../../node_modules/@gmod/tabix/esm/chunk.js
6
- var o = class {
7
- constructor(e, t, n, r) {
8
- this.minv = e, this.maxv = t, this.bin = n, this._fetchedSize = r;
9
- }
10
- toUniqueString() {
11
- return `${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`;
12
- }
13
- toString() {
14
- return this.toUniqueString();
15
- }
16
- compareTo(e) {
17
- return this.minv.compareTo(e.minv) || this.maxv.compareTo(e.maxv) || this.bin - e.bin;
18
- }
19
- fetchedSize() {
20
- return this._fetchedSize === void 0 ? this.maxv.blockPosition + 65536 - this.minv.blockPosition : this._fetchedSize;
21
- }
22
- }, s = class {
23
- constructor({ filehandle: e, renameRefSeqs: t = (e) => e }) {
24
- this.filehandle = e, this.renameRefSeq = t;
25
- }
26
- async getMetadata(e = {}) {
27
- let { indices: t, ...n } = await this.parse(e);
28
- return n;
29
- }
30
- _findFirstData(e, t) {
31
- return e ? e.compareTo(t) > 0 ? t : e : t;
32
- }
33
- async parse(e = {}) {
34
- return this.parseP ||= this._parse(e).catch((e) => {
35
- throw this.parseP = void 0, e;
36
- }), this.parseP;
37
- }
38
- async hasRefSeq(e, t = {}) {
39
- return !!(await this.parse(t)).indices[e]?.binIndex;
40
- }
41
- _parseNameBytes(e) {
42
- let t = 0, n = 0, r = [], i = {}, a = new TextDecoder("utf8");
43
- for (let o = 0; o < e.length; o += 1) if (!e[o]) {
44
- if (n < o) {
45
- let s = this.renameRefSeq(a.decode(e.subarray(n, o)));
46
- r[t] = s, i[s] = t;
47
- }
48
- n = o + 1, t += 1;
49
- }
50
- return {
51
- refNameToId: i,
52
- refIdToName: r
53
- };
54
- }
55
- }, c = 65536, l = c * c;
56
- function u(e, t = 0) {
57
- let n = e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24;
58
- return ((e[t + 4] | e[t + 5] << 8 | e[t + 6] << 16 | e[t + 7] << 24) >>> 0) * l + (n >>> 0);
59
- }
60
- //#endregion
61
- //#region ../../node_modules/@gmod/tabix/esm/util.js
62
- function d(e, t) {
63
- return t.minv.blockPosition - e.maxv.blockPosition < 65e3 && t.maxv.blockPosition - e.minv.blockPosition < 5e6;
64
- }
65
- function f(e, t) {
66
- let n = [], r;
67
- if (e.length === 0) return e;
68
- e.sort(function(e, t) {
69
- let n = e.minv.blockPosition - t.minv.blockPosition;
70
- return n === 0 ? e.minv.dataPosition - t.minv.dataPosition : n;
71
- });
72
- for (let i of e) (!t || i.maxv.compareTo(t) > 0) && (r === void 0 ? (n.push(i), r = i) : d(r, i) ? i.maxv.compareTo(r.maxv) > 0 && (r.maxv = i.maxv) : (n.push(i), r = i));
73
- return n;
74
- }
75
- //#endregion
76
- //#region ../../node_modules/@gmod/tabix/esm/virtualOffset.js
77
- var p = class {
78
- constructor(e, t) {
79
- this.blockPosition = e, this.dataPosition = t;
80
- }
81
- toString() {
82
- return `${this.blockPosition}:${this.dataPosition}`;
83
- }
84
- compareTo(e) {
85
- return this.blockPosition - e.blockPosition || this.dataPosition - e.dataPosition;
86
- }
87
- };
88
- function m(e, t = 0) {
89
- return new p(e[t + 7] * 1099511627776 + e[t + 6] * 4294967296 + e[t + 5] * 16777216 + e[t + 4] * 65536 + e[t + 3] * 256 + e[t + 2], e[t + 1] << 8 | e[t]);
90
- }
91
- //#endregion
92
- //#region ../../node_modules/@gmod/tabix/esm/csi.js
93
- var h = 21582659, g = 38359875, _ = {
94
- 0: "generic",
95
- 1: "SAM",
96
- 2: "VCF"
97
- };
98
- function v(e, t) {
99
- return e * 2 ** t;
100
- }
101
- function y(e, t) {
102
- return Math.floor(e / 2 ** t);
103
- }
104
- var b = class extends s {
105
- constructor(e) {
106
- super(e), this.maxBinNumber = 0, this.depth = 0, this.minShift = 0;
107
- }
108
- async lineCount(e, t = {}) {
109
- let n = await this.parse(t), r = n.refNameToId[e];
110
- if (r === void 0 || !n.indices[r]) return -1;
111
- let { stats: i } = n.indices[r];
112
- return i ? i.lineCount : -1;
113
- }
114
- indexCov() {
115
- throw Error("CSI indexes do not support indexcov");
116
- }
117
- parseAuxData(e, t) {
118
- let n = new DataView(e.buffer), r = n.getInt32(t, !0), i = r & 65536 ? "zero-based-half-open" : "1-based-closed", a = _[r & 15];
119
- if (!a) throw Error(`invalid Tabix preset format flags ${r}`);
120
- let o = {
121
- ref: n.getInt32(t + 4, !0),
122
- start: n.getInt32(t + 8, !0),
123
- end: n.getInt32(t + 12, !0)
124
- }, s = n.getInt32(t + 16, !0), c = s ? String.fromCharCode(s) : void 0, l = n.getInt32(t + 20, !0), u = n.getInt32(t + 24, !0), { refIdToName: d, refNameToId: f } = this._parseNameBytes(e.subarray(t + 28, t + 28 + u));
125
- return {
126
- refIdToName: d,
127
- refNameToId: f,
128
- skipLines: l,
129
- metaChar: c,
130
- columnNumbers: o,
131
- format: a,
132
- coordinateType: i
133
- };
134
- }
135
- async _parse(e = {}) {
136
- let n = await t(await this.filehandle.readFile(e)), r = new DataView(n.buffer), i;
137
- if (r.getUint32(0, !0) === h) i = 1;
138
- else if (r.getUint32(0, !0) === g) i = 2;
139
- else throw Error("Not a CSI file");
140
- this.minShift = r.getInt32(4, !0), this.depth = r.getInt32(8, !0), this.maxBinNumber = ((1 << (this.depth + 1) * 3) - 1) / 7;
141
- let a = 2 ** (this.minShift + this.depth * 3), s = r.getInt32(12, !0), c = s && s >= 30 ? this.parseAuxData(n, 16) : {
142
- refIdToName: [],
143
- refNameToId: {},
144
- metaChar: void 0,
145
- columnNumbers: {
146
- ref: 0,
147
- start: 1,
148
- end: 2
149
- },
150
- coordinateType: "zero-based-half-open",
151
- format: "generic"
152
- }, l = r.getInt32(16 + s, !0), u, d = 16 + s + 4, f = Array(l).fill(0).map(() => {
153
- let e = r.getInt32(d, !0);
154
- d += 4;
155
- let t = {}, i;
156
- for (let a = 0; a < e; a += 1) {
157
- let e = r.getUint32(d, !0);
158
- if (e > this.maxBinNumber) i = this.parsePseudoBin(n, d + 4), d += 48;
159
- else {
160
- let i = m(n, d + 4);
161
- u = this._findFirstData(u, i);
162
- let a = r.getInt32(d + 12, !0);
163
- d += 16;
164
- let s = Array(a);
165
- for (let t = 0; t < a; t += 1) {
166
- let r = m(n, d), i = m(n, d + 8);
167
- d += 16, s[t] = new o(r, i, e);
168
- }
169
- t[e] = s;
170
- }
171
- }
172
- return {
173
- binIndex: t,
174
- stats: i
175
- };
176
- });
177
- return {
178
- ...c,
179
- csi: !0,
180
- refCount: l,
181
- maxBlockSize: 65536,
182
- firstDataLine: u,
183
- csiVersion: i,
184
- indices: f,
185
- depth: this.depth,
186
- maxBinNumber: this.maxBinNumber,
187
- maxRefLength: a
188
- };
189
- }
190
- parsePseudoBin(e, t) {
191
- return { lineCount: u(e, t + 28) };
192
- }
193
- async blocksForRange(e, t, n, r = {}) {
194
- t < 0 && (t = 0);
195
- let i = await this.parse(r), a = i.refNameToId[e];
196
- if (a === void 0) return [];
197
- let s = i.indices[a];
198
- if (!s) return [];
199
- let c = this.reg2bins(t, n), l = [];
200
- for (let [e, t] of c) for (let n = e; n <= t; n++) if (s.binIndex[n]) for (let e of s.binIndex[n]) l.push(new o(e.minv, e.maxv, n));
201
- return f(l, new p(0, 0));
202
- }
203
- reg2bins(e, t) {
204
- --e, e < 1 && (e = 1), t > 2 ** 50 && (t = 2 ** 34), --t;
205
- let n = 0, r = 0, i = this.minShift + this.depth * 3, a = [];
206
- for (; n <= this.depth; i -= 3, r += v(1, n * 3), n += 1) {
207
- let n = r + y(e, i), o = r + y(t, i);
208
- if (o - n + a.length > this.maxBinNumber) throw Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);
209
- a.push([n, o]);
210
- }
211
- return a;
212
- }
213
- }, x = 21578324, S = 14;
214
- function C(e, t) {
215
- return e += 1, --t, [
216
- [0, 0],
217
- [1 + (e >> 26), 1 + (t >> 26)],
218
- [9 + (e >> 23), 9 + (t >> 23)],
219
- [73 + (e >> 20), 73 + (t >> 20)],
220
- [585 + (e >> 17), 585 + (t >> 17)],
221
- [4681 + (e >> 14), 4681 + (t >> 14)]
222
- ];
223
- }
224
- var w = class extends s {
225
- async lineCount(e, t = {}) {
226
- let n = await this.parse(t), r = n.refNameToId[e];
227
- return r === void 0 || !n.indices[r] ? -1 : n.indices[r].stats?.lineCount ?? -1;
228
- }
229
- async _parse(e = {}) {
230
- let n = await this.filehandle.readFile(e), r = await t(n), i = new DataView(r.buffer);
231
- if (i.getUint32(0, !0) !== x) throw Error("Not a TBI file");
232
- let a = i.getUint32(4, !0), s = i.getUint32(8, !0), c = s & 65536 ? "zero-based-half-open" : "1-based-closed", l = {
233
- 0: "generic",
234
- 1: "SAM",
235
- 2: "VCF"
236
- }[s & 15];
237
- if (!l) throw Error(`invalid Tabix preset format flags ${s}`);
238
- let u = {
239
- ref: i.getInt32(12, !0),
240
- start: i.getInt32(16, !0),
241
- end: i.getInt32(20, !0)
242
- }, d = i.getInt32(24, !0), f = 2 ** 29, p = d ? String.fromCharCode(d) : void 0, h = i.getInt32(28, !0), g = i.getInt32(32, !0), { refNameToId: _, refIdToName: v } = this._parseNameBytes(r.slice(36, 36 + g)), y = 36 + g, b;
243
- return {
244
- indices: Array(a).fill(0).map(() => {
245
- let e = i.getInt32(y, !0);
246
- y += 4;
247
- let t = {}, n;
248
- for (let a = 0; a < e; a += 1) {
249
- let e = i.getUint32(y, !0);
250
- if (y += 4, e > 37450) throw Error("tabix index contains too many bins, please use a CSI index");
251
- if (e === 37450) {
252
- let e = i.getInt32(y, !0);
253
- y += 4, e === 2 && (n = this.parsePseudoBin(r, y)), y += 16 * e;
254
- } else {
255
- let n = i.getInt32(y, !0);
256
- y += 4;
257
- let a = Array(n);
258
- for (let t = 0; t < n; t += 1) {
259
- let n = m(r, y), i = m(r, y + 8);
260
- y += 16, b = this._findFirstData(b, n), a[t] = new o(n, i, e);
261
- }
262
- t[e] = a;
263
- }
264
- }
265
- let a = i.getInt32(y, !0);
266
- y += 4;
267
- let s = Array(a);
268
- for (let e = 0; e < a; e += 1) s[e] = m(r, y), y += 8, b = this._findFirstData(b, s[e]);
269
- return {
270
- binIndex: t,
271
- linearIndex: s,
272
- stats: n
273
- };
274
- }),
275
- metaChar: p,
276
- maxBinNumber: 37449,
277
- maxRefLength: f,
278
- skipLines: h,
279
- firstDataLine: b,
280
- columnNumbers: u,
281
- coordinateType: c,
282
- format: l,
283
- refIdToName: v,
284
- refNameToId: _,
285
- maxBlockSize: 65536
286
- };
287
- }
288
- parsePseudoBin(e, t) {
289
- return { lineCount: u(e, t + 16) };
290
- }
291
- async blocksForRange(e, t, n, r = {}) {
292
- t < 0 && (t = 0);
293
- let i = await this.parse(r), a = i.refNameToId[e];
294
- if (a === void 0) return [];
295
- let s = i.indices[a];
296
- if (!s) return [];
297
- (s.linearIndex.length > 0 ? s.linearIndex[t >> S >= s.linearIndex.length ? s.linearIndex.length - 1 : t >> S] : new p(0, 0)) || console.warn("querying outside of possible tabix range");
298
- let c = C(t, n), l = [];
299
- for (let [e, t] of c) for (let n = e; n <= t; n++) if (s.binIndex[n]) for (let e of s.binIndex[n]) l.push(new o(e.minv, e.maxv, n));
300
- let u = s.linearIndex.length, d, m = Math.min(t >> 14, u - 1), h = Math.min(n >> 14, u - 1);
301
- for (let e = m; e <= h; ++e) {
302
- let t = s.linearIndex[e];
303
- t && (!d || t.compareTo(d) < 0) && (d = t);
304
- }
305
- return f(l, d);
306
- }
307
- }, T = class {
308
- constructor({ path: t, filehandle: n, url: o, tbiPath: s, tbiUrl: c, tbiFilehandle: l, csiPath: u, csiUrl: d, csiFilehandle: f, renameRefSeqs: p, chunkCacheSize: m = 5 * 2 ** 20 }) {
309
- this.cache = new e({ maxSize: 1e3 });
310
- let h = p ?? ((e) => e);
311
- if (n) this.filehandle = n;
312
- else if (t) this.filehandle = new r(t);
313
- else if (o) this.filehandle = new i(o);
314
- else throw TypeError("must provide either filehandle or path");
315
- if (l) this.index = new w({
316
- filehandle: l,
317
- renameRefSeqs: h
318
- });
319
- else if (f) this.index = new b({
320
- filehandle: f,
321
- renameRefSeqs: h
322
- });
323
- else if (s) this.index = new w({
324
- filehandle: new r(s),
325
- renameRefSeqs: h
326
- });
327
- else if (u) this.index = new b({
328
- filehandle: new r(u),
329
- renameRefSeqs: h
330
- });
331
- else if (t) this.index = new w({
332
- filehandle: new r(`${t}.tbi`),
333
- renameRefSeqs: h
334
- });
335
- else if (d) this.index = new b({ filehandle: new i(d) });
336
- else if (c) this.index = new w({ filehandle: new i(c) });
337
- else if (o) this.index = new w({ filehandle: new i(`${o}.tbi`) });
338
- else throw TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");
339
- this.renameRefSeq = h, this.hasCustomRenameRefSeq = p !== void 0, this.chunkCache = new a({
340
- cache: new e({ maxSize: Math.floor(m / 65536) }),
341
- fill: (e, t) => this.readChunk(e, { signal: t })
342
- });
343
- }
344
- calculateFileOffset(e, t, n, r, i) {
345
- return e[n] * 256 + (r - t[n]) + i + 1;
346
- }
347
- async getLines(e, t, n, r) {
348
- let i, a = {}, o;
349
- typeof r == "function" ? o = r : (a = r, o = r.lineCallback, i = r.signal);
350
- let s = await this.index.getMetadata(a), c = t ?? 0, l = n ?? s.maxRefLength;
351
- if (!(c <= l)) throw TypeError("invalid start and end coordinates. start must be less than or equal to end");
352
- if (c === l) return;
353
- let u = await this.index.blocksForRange(e, c, l, a), d = new TextDecoder("utf8"), f = s.format === "VCF", p = {
354
- ref: s.columnNumbers.ref || 0,
355
- start: s.columnNumbers.start || 0,
356
- end: f ? 8 : s.columnNumbers.end || 0
357
- }, m = Math.max(p.ref, p.start, p.end), h = s.metaChar?.charCodeAt(0), g = s.coordinateType === "1-based-closed" ? -1 : 0, _ = !this.hasCustomRenameRefSeq;
358
- for (let t of u) {
359
- let { buffer: n, cpositions: r, dpositions: a } = await this.chunkCache.get(t.toString(), t, i), s = 0, u = 0, v = d.decode(n);
360
- if (n.length == v.length) for (; s < v.length;) {
361
- let n = v.indexOf("\n", s);
362
- if (n === -1) break;
363
- let i = v.slice(s, n);
364
- if (a) {
365
- let e = s + t.minv.dataPosition;
366
- for (; u < a.length && e >= a[u];) u++;
367
- }
368
- let d = this.checkLine(e, c, l, i, p.ref, p.start, p.end, m, h, g, f, _);
369
- if (d === null) return;
370
- d !== void 0 && o(i, this.calculateFileOffset(r, a, u, s, t.minv.dataPosition), d.start, d.end), s = n + 1;
371
- }
372
- else for (; s < n.length;) {
373
- let i = n.indexOf(10, s);
374
- if (i === -1) break;
375
- let v = n.slice(s, i), y = d.decode(v);
376
- if (a) {
377
- let e = s + t.minv.dataPosition;
378
- for (; u < a.length && e >= a[u];) u++;
379
- }
380
- let b = this.checkLine(e, c, l, y, p.ref, p.start, p.end, m, h, g, f, _);
381
- if (b === null) return;
382
- b !== void 0 && o(y, this.calculateFileOffset(r, a, u, s, t.minv.dataPosition), b.start, b.end), s = i + 1;
383
- }
384
- }
385
- }
386
- async getMetadata(e = {}) {
387
- return this.index.getMetadata(e);
388
- }
389
- async getHeaderBuffer(e = {}) {
390
- let { firstDataLine: n, metaChar: r, maxBlockSize: i } = await this.getMetadata(e), a = (n?.blockPosition || 0) + i, o = await this.filehandle.read(a, 0, e), s = await t(o);
391
- if (r) {
392
- let e = -1, t = r.charCodeAt(0);
393
- for (let n = 0, r = s.length; n < r; n++) {
394
- let r = s[n];
395
- if (n === e + 1 && r !== t) break;
396
- r === 10 && (e = n);
397
- }
398
- return s.subarray(0, e + 1);
399
- }
400
- return s;
401
- }
402
- async getHeader(e = {}) {
403
- let t = new TextDecoder("utf8"), n = await this.getHeaderBuffer(e);
404
- return t.decode(n);
405
- }
406
- async getReferenceSequenceNames(e = {}) {
407
- return (await this.getMetadata(e)).refIdToName;
408
- }
409
- checkLine(e, t, n, r, i, a, o, s, c, l, u, d) {
410
- if (c !== void 0 && r.charCodeAt(0) === c) return;
411
- if (r.length < 500) {
412
- let s = r.split(" "), c = s[i - 1];
413
- if (!(d ? c === e : this.renameRefSeq(c) === e)) return;
414
- let f = +s[a - 1] + l;
415
- if (f >= n) return null;
416
- let p;
417
- return p = o === 0 || o === a ? f + 1 : u ? this._getVcfEnd(f, s[3], s[o - 1]) : +s[o - 1], p <= t ? void 0 : {
418
- start: f,
419
- end: p
420
- };
421
- }
422
- let f = -1, p = [-1];
423
- for (let e = 0; e < s; e++) {
424
- let e = r.indexOf(" ", f + 1);
425
- if (e === -1) {
426
- p.push(r.length);
427
- break;
428
- }
429
- p.push(e), f = e;
430
- }
431
- let m = r.slice(p[i - 1] + 1, p[i]);
432
- if (!(d ? m === e : this.renameRefSeq(m) === e)) return;
433
- let h = +r.slice(p[a - 1] + 1, p[a]) + l;
434
- if (h >= n) return null;
435
- let g;
436
- if (g = o === 0 || o === a ? h + 1 : u ? this._getVcfEnd(h, r.slice(p[3] + 1, p[4]), r.slice(p[o - 1] + 1, p[o])) : +r.slice(p[o - 1] + 1, p[o]), !(g <= t)) return {
437
- start: h,
438
- end: g
439
- };
440
- }
441
- _getVcfEnd(e, t, n) {
442
- let r = e + t.length;
443
- if (n.includes("SVTYPE=TRA")) return e + 1;
444
- if (n[0] !== ".") {
445
- let e = n.indexOf("END=");
446
- if (e !== -1 && (e === 0 || n[e - 1] === ";")) {
447
- let t = e + 4, i = n.indexOf(";", t);
448
- i === -1 && (i = n.length), r = Number.parseInt(n.slice(t, i), 10);
449
- }
450
- }
451
- return r;
452
- }
453
- async lineCount(e, t = {}) {
454
- return this.index.lineCount(e, t);
455
- }
456
- async readChunk(e, t = {}) {
457
- let r = await this.filehandle.read(e.fetchedSize(), e.minv.blockPosition, t);
458
- return n(r, e, this.cache);
459
- }
460
- };
461
- //#endregion
462
- export { b as CSI, w as TBI, T as TabixIndexedFile };