@genome-spy/app 0.73.0 → 0.75.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/AbortablePromiseCache-3gHJdF3E.js +96 -0
- package/dist/blosc-oa0DlI6G.js +692 -0
- package/dist/browser-Dvlo92rx.js +126 -0
- package/dist/chunk-CPXzm0be.js +11 -0
- package/dist/chunk-INHXZS53-fPMmEwMt.js +13 -0
- package/dist/esm-B8-vSu-c.js +369 -0
- package/dist/esm-BDFRLEuD.js +1248 -0
- package/dist/esm-BygJiwh0.js +573 -0
- package/dist/esm-CGX-qz1d.js +155 -0
- package/dist/esm-Cmo4qEPr.js +1015 -0
- package/dist/esm-CuMSzCHy.js +298 -0
- package/dist/esm-D-WfYOx7.js +461 -0
- package/dist/esm-DCCYNvaz.js +1426 -0
- package/dist/esm-n0auOe11.js +121 -0
- package/dist/index.es.js +41252 -52718
- package/dist/index.js +1093 -1099
- package/dist/lz4-jZ0zyLBa.js +626 -0
- package/dist/parquetRead-CJe1UPsz.js +1609 -0
- package/dist/schema.json +11293 -5027
- package/dist/style.css +2 -1
- package/dist/zstd-C6ksIG9r.js +583 -0
- package/package.json +14 -5
- package/dist/AbortablePromiseCache-Dj0vzLnp.js +0 -149
- package/dist/blosc-D1xNXZJs.js +0 -719
- package/dist/browser-0iNU5Wit.js +0 -138
- package/dist/chunk-INHXZS53-DiyuLb3Z.js +0 -14
- package/dist/index-BUsSzlHg.js +0 -1771
- package/dist/index-BYsZN7b0.js +0 -1597
- package/dist/index-C7wOh6y1.js +0 -657
- package/dist/index-CRaQAuki.js +0 -326
- package/dist/index-D9v1PCj9.js +0 -507
- package/dist/index-GDOuv_D5.js +0 -266
- package/dist/index-Gt44EOIH.js +0 -628
- package/dist/inflate-GtwLkvSP.js +0 -1048
- package/dist/lz4-1Ws5oVWR.js +0 -640
- package/dist/parquetRead-BnAGCa4_.js +0 -1663
- package/dist/unzip-Bac01w6X.js +0 -1492
- package/dist/zstd-C4EcZnjq.js +0 -603
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { t as e } from "./esm-BDFRLEuD.js";
|
|
2
|
+
import { t } from "./browser-Dvlo92rx.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 };
|