@genome-spy/app 0.78.0 → 0.79.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.
- package/dist/agentApi.es.js +4918 -2499
- package/dist/agentShared.es.js +20 -22
- package/dist/{blosc-DL1kZHdE.js → blosc-JROzDOnd.js} +1 -1
- package/dist/{chunk-INHXZS53-DwEV9sMh.js → chunk-INHXZS53-CsrPGdTf.js} +1 -1
- package/dist/{componentStyles-CIXoKEp0.js → componentStyles-BGy033io.js} +2 -2
- package/dist/dialog.es.js +3 -3
- package/dist/{esm-D2-C5ZzN.js → esm-80V4xF_D.js} +226 -212
- package/dist/esm-B8j57WO7.js +441 -0
- package/dist/{esm-BkagIzhP.js → esm-BEHZgiVL.js} +30 -30
- package/dist/esm-BNd2PfFt.js +1367 -0
- package/dist/esm-BdLYkz-m.js +248 -0
- package/dist/{esm-id9DWBZW.js → esm-BdT7qUL-.js} +51 -31
- package/dist/esm-Bn4VTHqw.js +128 -0
- package/dist/{esm-C_XrKaCY.js → esm-C3k-CPce.js} +51 -31
- package/dist/{esm-CHVYSGF2.js → esm-CPzTvCZH.js} +226 -212
- package/dist/{esm-CPufCnsG.js → esm-CWd6i_cL.js} +30 -30
- package/dist/{esm-BgpwI2cq.js → esm-Cx-EbkOj.js} +13 -13
- package/dist/esm-D-iG_TIX.js +441 -0
- package/dist/esm-WxH0jQt4.js +128 -0
- package/dist/esm-cvhwoclu.js +1367 -0
- package/dist/{esm-BL9SNSnj.js → esm-k9p3oHkt.js} +133 -158
- package/dist/index.es.js +41477 -11008
- package/dist/index.js +579 -662
- package/dist/{lit-ymUSmGBw.js → lit-ByuJ0FJ4.js} +1 -1
- package/dist/{lz4-Csz5aoFA.js → lz4-CUYSbVey.js} +1 -1
- package/dist/{parquetRead-C33mgLEo.js → parquetRead-CBUyqZwZ.js} +473 -399
- package/dist/{chunk-CPXzm0be.js → rolldown-runtime-DF993M8W.js} +1 -1
- package/dist/schema.json +20018 -6213
- package/dist/{viewUtils-B7-F_Ae-.js → viewUtils-BBRWguwj.js} +4947 -4127
- package/dist/{zstd-dJuUp1fl.js → zstd-YMzMcush.js} +1 -1
- package/package.json +6 -4
- package/src/appTypes.d.ts +0 -1
- package/src/sampleView/state/payloadTypes.d.ts +9 -2
- package/src/spec/sampleView.d.ts +53 -0
- package/dist/AbortablePromiseCache-beUIcZcW.js +0 -96
- package/dist/agentApi-BwbEWjvl.js +0 -27118
- package/dist/blosc-BX4BJ8sR.js +0 -692
- package/dist/chunk-INHXZS53-Dx2aFznx.js +0 -13
- package/dist/esm-BHjeb8gt.js +0 -1426
- package/dist/esm-BI-plmf6.js +0 -121
- package/dist/esm-BwW--bVV.js +0 -369
- package/dist/esm-COzpU5N8.js +0 -1221
- package/dist/esm-CZvS2Ldm.js +0 -155
- package/dist/esm-D-y0Ce1M.js +0 -573
- package/dist/esm-D2_c7lXY.js +0 -298
- package/dist/esm-Daho46bY.js +0 -121
- package/dist/esm-DjF6pKy5.js +0 -369
- package/dist/esm-sPWfZg9X.js +0 -1426
- package/dist/esm-s_SlArJ8.js +0 -298
- package/dist/lz4-BSYl80V8.js +0 -626
- package/dist/parquetRead-m8-8_SpH.js +0 -1609
- package/dist/zstd-BAfRM3IH.js +0 -583
- /package/dist/{AbortablePromiseCache-BDH1cqFl.js → AbortablePromiseCache-BTmAcN-t.js} +0 -0
- /package/dist/{esm-Bz_92nH0.js → esm-VvpZ9hsq.js} +0 -0
package/dist/esm-D2_c7lXY.js
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/gff-nostream/esm/util.js
|
|
2
|
-
var e = {};
|
|
3
|
-
for (let t = 0; t < 256; t++) {
|
|
4
|
-
let n = t.toString(16).toUpperCase().padStart(2, "0");
|
|
5
|
-
e[n] = String.fromCharCode(t), e[n.toLowerCase()] = String.fromCharCode(t);
|
|
6
|
-
}
|
|
7
|
-
function t(t) {
|
|
8
|
-
let n = t.indexOf("%");
|
|
9
|
-
if (n === -1) return t;
|
|
10
|
-
let r = "", i = 0, a = n;
|
|
11
|
-
for (; a < t.length;) if (t[a] === "%" && a + 2 < t.length) {
|
|
12
|
-
r += t.slice(i, a);
|
|
13
|
-
let n = e[t.slice(a + 1, a + 3)];
|
|
14
|
-
n === void 0 ? r += t.slice(a, a + 3) : r += n, a += 3, i = a;
|
|
15
|
-
} else a++;
|
|
16
|
-
return r + t.slice(i);
|
|
17
|
-
}
|
|
18
|
-
function n(e) {
|
|
19
|
-
if (e.length === 0 || e === ".") return {};
|
|
20
|
-
let n = {}, r = e.length;
|
|
21
|
-
e[r - 1] === "\n" && (r = e[r - 2] === "\r" ? r - 2 : r - 1, e = e.slice(0, r));
|
|
22
|
-
let i = 0;
|
|
23
|
-
for (; i < r;) {
|
|
24
|
-
let a = e.indexOf(";", i);
|
|
25
|
-
if (a === -1 && (a = r), a > i) {
|
|
26
|
-
let r = e.indexOf("=", i);
|
|
27
|
-
if (r !== -1 && r < a && r + 1 < a) {
|
|
28
|
-
let o = e.slice(i, r), s = n[o];
|
|
29
|
-
s || (s = [], n[o] = s);
|
|
30
|
-
let c = r + 1;
|
|
31
|
-
for (; c < a;) {
|
|
32
|
-
let n = e.indexOf(",", c);
|
|
33
|
-
if ((n === -1 || n > a) && (n = a), n > c) {
|
|
34
|
-
let r = e.slice(c, n);
|
|
35
|
-
s.push(t(r));
|
|
36
|
-
}
|
|
37
|
-
c = n + 1;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
i = a + 1;
|
|
42
|
-
}
|
|
43
|
-
return n;
|
|
44
|
-
}
|
|
45
|
-
function r(e) {
|
|
46
|
-
if (e.length === 0 || e === ".") return {};
|
|
47
|
-
let t = {}, n = e.length;
|
|
48
|
-
e[n - 1] === "\n" && (n = e[n - 2] === "\r" ? n - 2 : n - 1, e = e.slice(0, n));
|
|
49
|
-
let r = 0;
|
|
50
|
-
for (; r < n;) {
|
|
51
|
-
let i = e.indexOf(";", r);
|
|
52
|
-
if (i === -1 && (i = n), i > r) {
|
|
53
|
-
let n = e.indexOf("=", r);
|
|
54
|
-
if (n !== -1 && n < i && n + 1 < i) {
|
|
55
|
-
let a = e.slice(r, n), o = t[a];
|
|
56
|
-
o || (o = [], t[a] = o);
|
|
57
|
-
let s = n + 1;
|
|
58
|
-
for (; s < i;) {
|
|
59
|
-
let t = e.indexOf(",", s);
|
|
60
|
-
(t === -1 || t > i) && (t = i), t > s && o.push(e.slice(s, t)), s = t + 1;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
r = i + 1;
|
|
65
|
-
}
|
|
66
|
-
return t;
|
|
67
|
-
}
|
|
68
|
-
function i(e) {
|
|
69
|
-
return e.length === 0 || e === "." ? null : t(e);
|
|
70
|
-
}
|
|
71
|
-
function a(e) {
|
|
72
|
-
return e.length === 0 || e === "." ? null : e;
|
|
73
|
-
}
|
|
74
|
-
function o(e) {
|
|
75
|
-
let t = e.split(" "), r = t[0], o = t[1], s = t[2], c = t[3], l = t[4], u = t[5], d = t[6], f = t[7], p = t[8];
|
|
76
|
-
return {
|
|
77
|
-
seq_id: i(r),
|
|
78
|
-
source: i(o),
|
|
79
|
-
type: i(s),
|
|
80
|
-
start: c.length === 0 || c === "." ? null : +c,
|
|
81
|
-
end: l.length === 0 || l === "." ? null : +l,
|
|
82
|
-
score: u.length === 0 || u === "." ? null : +u,
|
|
83
|
-
strand: a(d),
|
|
84
|
-
phase: a(f),
|
|
85
|
-
attributes: p.length === 0 || p === "." ? null : n(p)
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function s(e) {
|
|
89
|
-
let t = e.split(" "), n = t[0], i = t[1], o = t[2], s = t[3], c = t[4], l = t[5], u = t[6], d = t[7], f = t[8];
|
|
90
|
-
return {
|
|
91
|
-
seq_id: a(n),
|
|
92
|
-
source: a(i),
|
|
93
|
-
type: a(o),
|
|
94
|
-
start: s.length === 0 || s === "." ? null : +s,
|
|
95
|
-
end: c.length === 0 || c === "." ? null : +c,
|
|
96
|
-
score: l.length === 0 || l === "." ? null : +l,
|
|
97
|
-
strand: a(u),
|
|
98
|
-
phase: a(d),
|
|
99
|
-
attributes: f.length === 0 || f === "." ? null : r(f)
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
var c = new Set([
|
|
103
|
-
"start",
|
|
104
|
-
"end",
|
|
105
|
-
"seq_id",
|
|
106
|
-
"score",
|
|
107
|
-
"type",
|
|
108
|
-
"source",
|
|
109
|
-
"phase",
|
|
110
|
-
"strand"
|
|
111
|
-
]);
|
|
112
|
-
function l(e) {
|
|
113
|
-
if (e === "+") return 1;
|
|
114
|
-
if (e === "-") return -1;
|
|
115
|
-
if (e === ".") return 0;
|
|
116
|
-
}
|
|
117
|
-
function u(e, n) {
|
|
118
|
-
if (e.length === 0 || e === ".") return;
|
|
119
|
-
let r = e.length;
|
|
120
|
-
e[r - 1] === "\n" && (r = e[r - 2] === "\r" ? r - 2 : r - 1, e = e.slice(0, r));
|
|
121
|
-
let i = 0;
|
|
122
|
-
for (; i < r;) {
|
|
123
|
-
let a = e.indexOf(";", i);
|
|
124
|
-
if (a === -1 && (a = r), a > i) {
|
|
125
|
-
let r = e.indexOf("=", i);
|
|
126
|
-
if (r !== -1 && r < a && r + 1 < a) {
|
|
127
|
-
let o = e.slice(i, r);
|
|
128
|
-
if (o === "_lineHash") {
|
|
129
|
-
i = a + 1;
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
let s = o.toLowerCase();
|
|
133
|
-
c.has(s) && (s += "2");
|
|
134
|
-
let l = [], u = r + 1;
|
|
135
|
-
for (; u < a;) {
|
|
136
|
-
let n = e.indexOf(",", u);
|
|
137
|
-
if ((n === -1 || n > a) && (n = a), n > u) {
|
|
138
|
-
let r = e.slice(u, n);
|
|
139
|
-
l.push(t(r));
|
|
140
|
-
}
|
|
141
|
-
u = n + 1;
|
|
142
|
-
}
|
|
143
|
-
n[s] = l.length === 1 ? l[0] : l;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
i = a + 1;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function d(e, t) {
|
|
150
|
-
if (e.length === 0 || e === ".") return;
|
|
151
|
-
let n = e.length;
|
|
152
|
-
e[n - 1] === "\n" && (n = e[n - 2] === "\r" ? n - 2 : n - 1, e = e.slice(0, n));
|
|
153
|
-
let r = 0;
|
|
154
|
-
for (; r < n;) {
|
|
155
|
-
let i = e.indexOf(";", r);
|
|
156
|
-
if (i === -1 && (i = n), i > r) {
|
|
157
|
-
let n = e.indexOf("=", r);
|
|
158
|
-
if (n !== -1 && n < i && n + 1 < i) {
|
|
159
|
-
let a = e.slice(r, n);
|
|
160
|
-
if (a === "_lineHash") {
|
|
161
|
-
r = i + 1;
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
let o = a.toLowerCase();
|
|
165
|
-
c.has(o) && (o += "2");
|
|
166
|
-
let s = [], l = n + 1;
|
|
167
|
-
for (; l < i;) {
|
|
168
|
-
let t = e.indexOf(",", l);
|
|
169
|
-
(t === -1 || t > i) && (t = i), t > l && s.push(e.slice(l, t)), l = t + 1;
|
|
170
|
-
}
|
|
171
|
-
t[o] = s.length === 1 ? s[0] : s;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
r = i + 1;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function f(e) {
|
|
178
|
-
let n = e.split(" "), r = n[0], i = n[1], a = n[2], o = n[3], s = n[4], c = n[5], d = n[6], f = n[7], p = n[8], m = {
|
|
179
|
-
refName: r.length === 0 || r === "." ? "" : t(r),
|
|
180
|
-
source: i.length === 0 || i === "." ? null : t(i),
|
|
181
|
-
type: a.length === 0 || a === "." ? null : t(a),
|
|
182
|
-
start: o.length === 0 || o === "." ? 0 : o - 1,
|
|
183
|
-
end: s.length === 0 || s === "." ? 0 : +s,
|
|
184
|
-
score: c.length === 0 || c === "." ? void 0 : +c,
|
|
185
|
-
strand: l(d),
|
|
186
|
-
phase: f.length === 0 || f === "." ? void 0 : +f,
|
|
187
|
-
subfeatures: []
|
|
188
|
-
};
|
|
189
|
-
return u(p, m), m;
|
|
190
|
-
}
|
|
191
|
-
function p(e) {
|
|
192
|
-
let t = e.split(" "), n = t[0], r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6], u = t[7], f = t[8], p = {
|
|
193
|
-
refName: n.length === 0 || n === "." ? "" : n,
|
|
194
|
-
source: r.length === 0 || r === "." ? null : r,
|
|
195
|
-
type: i.length === 0 || i === "." ? null : i,
|
|
196
|
-
start: a.length === 0 || a === "." ? 0 : a - 1,
|
|
197
|
-
end: o.length === 0 || o === "." ? 0 : +o,
|
|
198
|
-
score: s.length === 0 || s === "." ? void 0 : +s,
|
|
199
|
-
strand: l(c),
|
|
200
|
-
phase: u.length === 0 || u === "." ? void 0 : +u,
|
|
201
|
-
subfeatures: []
|
|
202
|
-
};
|
|
203
|
-
return d(f, p), p;
|
|
204
|
-
}
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region ../../node_modules/gff-nostream/esm/api.js
|
|
207
|
-
function m(e) {
|
|
208
|
-
return _(g(e));
|
|
209
|
-
}
|
|
210
|
-
function h(e) {
|
|
211
|
-
return v(g(e));
|
|
212
|
-
}
|
|
213
|
-
function g(e) {
|
|
214
|
-
let t = e.split(/\r?\n/), n = [];
|
|
215
|
-
for (let e = 0; e < t.length; e++) {
|
|
216
|
-
let r = t[e];
|
|
217
|
-
if (r.length === 0 || r[0] === "#") {
|
|
218
|
-
if (r.startsWith("##FASTA")) break;
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
if (r[0] === ">") break;
|
|
222
|
-
n.push({
|
|
223
|
-
line: r,
|
|
224
|
-
start: 0,
|
|
225
|
-
end: 0,
|
|
226
|
-
hasEscapes: r.includes("%")
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
return n;
|
|
230
|
-
}
|
|
231
|
-
function _(e) {
|
|
232
|
-
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
233
|
-
for (let i = 0; i < e.length; i++) {
|
|
234
|
-
let a = e[i], c = a.hasEscapes ? o(a.line) : s(a.line);
|
|
235
|
-
c.child_features = [], c.derived_features = [], a.lineHash !== void 0 && (c.attributes ||= {}, c.attributes._lineHash = [String(a.lineHash)]);
|
|
236
|
-
let l = c.attributes, u = l?.ID, d = l?.Parent;
|
|
237
|
-
if (!u && !d) {
|
|
238
|
-
t.push([c]);
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
let f;
|
|
242
|
-
if (u) {
|
|
243
|
-
let e = u[0], i = n.get(e);
|
|
244
|
-
if (i) i.push(c), f = i;
|
|
245
|
-
else {
|
|
246
|
-
f = [c], d || t.push(f), n.set(e, f);
|
|
247
|
-
let i = r.get(e);
|
|
248
|
-
if (i) {
|
|
249
|
-
for (let e = 0; e < i.length; e++) c.child_features.push(i[e]);
|
|
250
|
-
r.delete(e);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
} else f = [c];
|
|
254
|
-
if (d) for (let e = 0; e < d.length; e++) {
|
|
255
|
-
let t = d[e], i = n.get(t);
|
|
256
|
-
if (i) for (let e = 0; e < i.length; e++) i[e].child_features.push(f);
|
|
257
|
-
else {
|
|
258
|
-
let e = r.get(t);
|
|
259
|
-
e || (e = [], r.set(t, e)), e.push(f);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return t;
|
|
264
|
-
}
|
|
265
|
-
function v(e) {
|
|
266
|
-
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
267
|
-
for (let i = 0; i < e.length; i++) {
|
|
268
|
-
let a = e[i], o = a.hasEscapes ? f(a.line) : p(a.line);
|
|
269
|
-
a.lineHash !== void 0 && (o._lineHash = String(a.lineHash));
|
|
270
|
-
let s = o.id, c = o.parent;
|
|
271
|
-
if (!s && !c) {
|
|
272
|
-
t.push(o);
|
|
273
|
-
continue;
|
|
274
|
-
}
|
|
275
|
-
if (s && !n.get(s)) {
|
|
276
|
-
c || t.push(o), n.set(s, o);
|
|
277
|
-
let e = r.get(s);
|
|
278
|
-
if (e) {
|
|
279
|
-
for (let t = 0; t < e.length; t++) o.subfeatures.push(e[t]);
|
|
280
|
-
r.delete(s);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
if (c) {
|
|
284
|
-
let e = Array.isArray(c) ? c : [c];
|
|
285
|
-
for (let t = 0; t < e.length; t++) {
|
|
286
|
-
let i = e[t], a = n.get(i);
|
|
287
|
-
if (a) a.subfeatures.push(o);
|
|
288
|
-
else {
|
|
289
|
-
let e = r.get(i);
|
|
290
|
-
e || (e = [], r.set(i, e)), e.push(o);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return t;
|
|
296
|
-
}
|
|
297
|
-
//#endregion
|
|
298
|
-
export { _ as parseRecords, v as parseRecordsJBrowse, m as parseStringSync, h as parseStringSyncJBrowse };
|
package/dist/esm-Daho46bY.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./esm-BgpwI2cq.js";
|
|
2
|
-
import { n as t } from "./esm-C_XrKaCY.js";
|
|
3
|
-
//#region ../core/node_modules/@gmod/indexedfasta/esm/indexedFasta.js
|
|
4
|
-
function n(e, t, n, r) {
|
|
5
|
-
return e + t * Math.floor(r / n) + r % n;
|
|
6
|
-
}
|
|
7
|
-
async function r(e, t = {}) {
|
|
8
|
-
let n = new TextDecoder("utf8").decode(await e.readFile(t)), r = [], i = [], a = [], o = [], s = [], c = {}, l = 0, u = n.length, d = 0;
|
|
9
|
-
for (; l < u;) {
|
|
10
|
-
let e = n.indexOf("\n", l);
|
|
11
|
-
e === -1 && (e = u);
|
|
12
|
-
let t = n.slice(l, e);
|
|
13
|
-
if (t.endsWith("\r") && (t = t.slice(0, -1)), t = t.trim(), l = e + 1, t.length === 0) continue;
|
|
14
|
-
let f = t.indexOf(" "), p = t.indexOf(" ", f + 1), m = t.indexOf(" ", p + 1), h = t.indexOf(" ", m + 1), g = t.slice(0, f);
|
|
15
|
-
if (g.startsWith(">")) throw Error("found > in sequence name, might have supplied FASTA file for the FASTA index");
|
|
16
|
-
r.push(g), a.push(+t.slice(f + 1, p)), i.push(+t.slice(p + 1, m)), o.push(+t.slice(m + 1, h)), s.push(+t.slice(h + 1)), c[g] = d, d++;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
names: r,
|
|
20
|
-
nameToIndex: c,
|
|
21
|
-
offsets: i,
|
|
22
|
-
lengths: a,
|
|
23
|
-
lineLengths: o,
|
|
24
|
-
lineBytes: s
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
var i = class {
|
|
28
|
-
constructor({ fasta: e, fai: n, path: r, faiPath: i }) {
|
|
29
|
-
if (e) this.fasta = e;
|
|
30
|
-
else if (r) this.fasta = new t(r);
|
|
31
|
-
else throw Error("Need to pass filehandle for fasta or path to localfile");
|
|
32
|
-
if (n) this.fai = n;
|
|
33
|
-
else if (i) this.fai = new t(i);
|
|
34
|
-
else if (r) this.fai = new t(`${r}.fai`);
|
|
35
|
-
else throw Error("Need to pass filehandle for or path to localfile");
|
|
36
|
-
}
|
|
37
|
-
async _getIndexes(e) {
|
|
38
|
-
return this.indexes ||= r(this.fai, e).catch((e) => {
|
|
39
|
-
throw this.indexes = void 0, e;
|
|
40
|
-
}), this.indexes;
|
|
41
|
-
}
|
|
42
|
-
async getSequenceNames(e) {
|
|
43
|
-
return (await this._getIndexes(e)).names;
|
|
44
|
-
}
|
|
45
|
-
async getSequenceSizes(e) {
|
|
46
|
-
let t = await this._getIndexes(e);
|
|
47
|
-
if (!t.sizesCache) {
|
|
48
|
-
let e = {};
|
|
49
|
-
for (let n = 0; n < t.names.length; n++) e[t.names[n]] = t.lengths[n];
|
|
50
|
-
t.sizesCache = e;
|
|
51
|
-
}
|
|
52
|
-
return t.sizesCache;
|
|
53
|
-
}
|
|
54
|
-
async getSequenceSize(e, t) {
|
|
55
|
-
let n = await this._getIndexes(t), r = n.nameToIndex[e];
|
|
56
|
-
return r === void 0 ? void 0 : n.lengths[r];
|
|
57
|
-
}
|
|
58
|
-
async hasReferenceSequence(e, t) {
|
|
59
|
-
return (await this._getIndexes(t)).nameToIndex[e] !== void 0;
|
|
60
|
-
}
|
|
61
|
-
async getResiduesByName(e, t, n, r) {
|
|
62
|
-
let i = await this._getIndexes(r), a = i.nameToIndex[e];
|
|
63
|
-
if (a !== void 0) return this._fetchFromIndex(i.offsets[a], i.lineBytes[a], i.lineLengths[a], i.lengths[a], t, n, r);
|
|
64
|
-
}
|
|
65
|
-
async getSequence(e, t, n, r) {
|
|
66
|
-
return this.getResiduesByName(e, t, n, r);
|
|
67
|
-
}
|
|
68
|
-
async _fetchFromIndex(e, t, r, i, a = 0, o, s) {
|
|
69
|
-
let c = o;
|
|
70
|
-
if (a < 0) throw TypeError("regionStart cannot be less than 0");
|
|
71
|
-
if ((c === void 0 || c > i) && (c = i), a >= c) return "";
|
|
72
|
-
let l = n(e, t, r, a), u = n(e, t, r, c) - l, d = new TextDecoder("utf8").decode(await this.fasta.read(u, l, s)).replace(/\s+/g, "");
|
|
73
|
-
if (/[^\x20-\x7e]/.test(d.slice(0, 1e3))) throw Error("Non-ASCII characters detected in sequence. The file may be gzip compressed. Use BgzipIndexedFasta for bgzip files, or decompress the file.");
|
|
74
|
-
return d;
|
|
75
|
-
}
|
|
76
|
-
}, a = class extends i {
|
|
77
|
-
constructor({ fasta: n, path: r, fai: i, faiPath: a, gzi: o, gziPath: s }) {
|
|
78
|
-
super({
|
|
79
|
-
fasta: n,
|
|
80
|
-
path: r,
|
|
81
|
-
fai: i,
|
|
82
|
-
faiPath: a
|
|
83
|
-
}), n && o ? this.fasta = new e({
|
|
84
|
-
filehandle: n,
|
|
85
|
-
gziFilehandle: o
|
|
86
|
-
}) : r && s && (this.fasta = new e({
|
|
87
|
-
filehandle: new t(r),
|
|
88
|
-
gziFilehandle: new t(s)
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region ../core/node_modules/@gmod/indexedfasta/esm/index.js
|
|
94
|
-
function o(e) {
|
|
95
|
-
return e.split(">").filter((e) => /\S/.test(e)).map((e) => {
|
|
96
|
-
let [t, ...n] = e.split("\n"), [r, ...i] = t.split(" "), a = n.join("").replace(/\s/g, "");
|
|
97
|
-
return {
|
|
98
|
-
id: r,
|
|
99
|
-
description: i.join(" "),
|
|
100
|
-
sequence: a
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
var s = class {
|
|
105
|
-
constructor({ fasta: e, path: n }) {
|
|
106
|
-
if (e) this.fasta = e;
|
|
107
|
-
else if (n) this.fasta = new t(n);
|
|
108
|
-
else throw Error("Need to pass fasta or path");
|
|
109
|
-
this.data = this.fasta.readFile().then((e) => o(new TextDecoder("utf8").decode(e)));
|
|
110
|
-
}
|
|
111
|
-
async fetch(e, t, n) {
|
|
112
|
-
let r = (await this.data).find((t) => t.id === e), i = n - t;
|
|
113
|
-
if (!r) throw Error(`no sequence with id ${e} exists`);
|
|
114
|
-
return r.sequence.slice(t, i);
|
|
115
|
-
}
|
|
116
|
-
async getSequenceNames() {
|
|
117
|
-
return (await this.data).map((e) => e.id);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
//#endregion
|
|
121
|
-
export { a as BgzipIndexedFasta, s as FetchableSmallFasta, i as IndexedFasta, o as parseSmallFasta };
|