@genome-spy/app 0.81.0 → 0.83.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.
@@ -1,4 +1,4 @@
1
- import { n as e, r as t } from "./esm-Cx-EbkOj.js";
1
+ import { n as e, r as t } from "./esm-CGLz7idZ.js";
2
2
  import { t as n } from "./esm-VvpZ9hsq.js";
3
3
  import { n as r, r as i } from "./esm-BdT7qUL-.js";
4
4
  import { t as a } from "./AbortablePromiseCache-BTmAcN-t.js";
@@ -1,4 +1,4 @@
1
- import { t as e } from "./esm-Cx-EbkOj.js";
1
+ import { t as e } from "./esm-CGLz7idZ.js";
2
2
  import { n as t } from "./esm-BdT7qUL-.js";
3
3
  //#region ../core/node_modules/@gmod/indexedfasta/esm/fetchableSmallFasta.js
4
4
  var n = new TextDecoder("utf8");
@@ -1,78 +1,76 @@
1
- //#region ../../node_modules/@gmod/vcf/esm/processGenotypes.js
2
- var e = 9, t = 58;
3
- function n(e) {
4
- let n = 0, r = 0, i = e.length;
5
- for (let a = 0; a <= i; a++) if (a === i || e.charCodeAt(a) === t) {
6
- if (a - r === 2 && e.charCodeAt(r) === 71 && e.charCodeAt(r + 1) === 84) return n;
7
- n++, r = a + 1;
1
+ function e(e) {
2
+ let t = 0, n = 0, r = e.length;
3
+ for (let i = 0; i <= r; i++) if (i === r || e.charCodeAt(i) === 58) {
4
+ if (i - n === 2 && e.charCodeAt(n) === 71 && e.charCodeAt(n + 1) === 84) return t;
5
+ t++, n = i + 1;
8
6
  }
9
7
  return -1;
10
8
  }
11
- function r(r, i, a, o) {
12
- let s = i.length, c = 0;
13
- if (r === "GT") {
14
- for (let t = 0; t < a; t++) {
15
- let n = c;
16
- for (; c < s && i.charCodeAt(c) !== e;) c++;
17
- o(i, n, c, t), c++;
9
+ function t(t, n, r, i) {
10
+ let a = n.length, o = 0;
11
+ if (t === "GT") {
12
+ for (let e = 0; e < r; e++) {
13
+ let t = o;
14
+ for (; o < a && n.charCodeAt(o) !== 9;) o++;
15
+ i(n, t, o, e), o++;
18
16
  }
19
17
  return;
20
18
  }
21
- let l = n(r);
22
- if (l !== -1) {
23
- if (l === 0) {
24
- for (let n = 0; n < a; n++) {
25
- let r = c;
26
- for (; c < s && i.charCodeAt(c) !== t && i.charCodeAt(c) !== e;) c++;
27
- for (o(i, r, c, n); c < s && i.charCodeAt(c) !== e;) c++;
28
- c++;
19
+ let s = e(t);
20
+ if (s !== -1) {
21
+ if (s === 0) {
22
+ for (let e = 0; e < r; e++) {
23
+ let t = o;
24
+ for (; o < a && n.charCodeAt(o) !== 58 && n.charCodeAt(o) !== 9;) o++;
25
+ for (i(n, t, o, e); o < a && n.charCodeAt(o) !== 9;) o++;
26
+ o++;
29
27
  }
30
28
  return;
31
29
  }
32
- for (let n = 0; n < a; n++) {
33
- let r = c, a = c;
34
- for (; a < s && i.charCodeAt(a) !== e;) a++;
35
- let u = 0, d = r;
36
- for (let e = r; e <= a; e++) if (e === a || i.charCodeAt(e) === t) {
37
- if (u === l) {
38
- o(i, d, e, n);
30
+ for (let e = 0; e < r; e++) {
31
+ let t = o, r = o;
32
+ for (; r < a && n.charCodeAt(r) !== 9;) r++;
33
+ let c = 0, l = t;
34
+ for (let a = t; a <= r; a++) if (a === r || n.charCodeAt(a) === 58) {
35
+ if (c === s) {
36
+ i(n, l, a, e);
39
37
  break;
40
38
  }
41
- u++, d = e + 1;
39
+ c++, l = a + 1;
42
40
  }
43
- c = a + 1;
41
+ o = r + 1;
44
42
  }
45
43
  }
46
44
  }
47
45
  //#endregion
48
46
  //#region ../../node_modules/@gmod/vcf/esm/parseGenotypesOnly.js
49
- function i(e, t, n) {
47
+ function n(e, n, r) {
50
48
  let i = Object.create(null);
51
- return r(e, t, n.length, (e, t, r, a) => {
52
- i[n[a] ?? ""] = e.slice(t, r);
49
+ return t(e, n, r.length, (e, t, n, a) => {
50
+ i[r[a] ?? ""] = e.slice(t, n);
53
51
  }), i;
54
52
  }
55
53
  //#endregion
56
54
  //#region ../../node_modules/@gmod/vcf/esm/parseInfo.js
57
- function a(e) {
55
+ function r(e) {
58
56
  try {
59
57
  return decodeURIComponent(e);
60
58
  } catch {
61
59
  return e;
62
60
  }
63
61
  }
64
- function o(e, t) {
65
- let n = {}, r = e.includes("%"), i = e.split(";"), o = i.length;
62
+ function i(e, t) {
63
+ let n = {}, i = e.includes("%"), a = e.split(";"), o = a.length;
66
64
  for (let e = 0; e < o; e++) {
67
- let o = i[e] ?? "", s = o.indexOf("="), c = s === -1 ? o : o.slice(0, s), l = s === -1 ? void 0 : o.slice(s + 1), u = t[c]?.Type;
65
+ let o = a[e] ?? "", s = o.indexOf("="), c = s === -1 ? o : o.slice(0, s), l = s === -1 ? void 0 : o.slice(s + 1), u = t[c]?.Type;
68
66
  if (u === "Flag" || !l) n[c] = !0;
69
67
  else {
70
- let e = u === "Integer" || u === "Float", t = l.split(","), i = t.length, o = [];
71
- for (let n = 0; n < i; n++) {
72
- let i = t[n] ?? "";
73
- if (i === ".") o.push(void 0);
68
+ let e = u === "Integer" || u === "Float", t = l.split(","), a = t.length, o = [];
69
+ for (let n = 0; n < a; n++) {
70
+ let a = t[n] ?? "";
71
+ if (a === ".") o.push(void 0);
74
72
  else {
75
- let t = r ? a(i) : i;
73
+ let t = i ? r(a) : a;
76
74
  o.push(e ? Number(t) : t);
77
75
  }
78
76
  }
@@ -83,7 +81,7 @@ function o(e, t) {
83
81
  }
84
82
  //#endregion
85
83
  //#region ../../node_modules/@gmod/vcf/esm/Variant.js
86
- var s = class {
84
+ var a = class {
87
85
  CHROM;
88
86
  POS;
89
87
  ID;
@@ -96,12 +94,12 @@ var s = class {
96
94
  formatMeta;
97
95
  rest;
98
96
  sampleNames;
99
- constructor(e, t, n, r, i) {
100
- let a = e.length, s = 0, c = 0;
101
- for (; s < a && c < 9;) e.charCodeAt(s) === 9 && (c += 1), s += 1;
97
+ constructor(e, t, n, r, a) {
98
+ let o = e.length, s = 0, c = 0;
99
+ for (; s < o && c < 9;) e.charCodeAt(s) === 9 && (c += 1), s += 1;
102
100
  let l = c === 9 ? s - 1 : s, u = e.slice(0, l).split(" "), d = e.slice(l + 1), [f, p, m, h, g, _, v] = u, y = v === "." ? void 0 : v?.split(";");
103
- if (i && !u[7]) throw Error("no INFO field specified, must contain at least a '.' (turn off strict mode to allow)");
104
- this.CHROM = f, this.POS = p === void 0 ? 0 : +p, this.ID = m === "." ? void 0 : m?.split(";"), this.REF = h, this.ALT = g === "." ? void 0 : g?.split(","), this.QUAL = _ === void 0 || _ === "." ? void 0 : +_, this.FILTER = y?.length === 1 && y[0] === "PASS" ? "PASS" : y, this.INFO = u[7] === void 0 || u[7] === "." ? {} : o(u[7], t), this.FORMAT = u[8], this.formatMeta = n, this.rest = d, this.sampleNames = r;
101
+ if (a && !u[7]) throw Error("no INFO field specified, must contain at least a '.' (turn off strict mode to allow)");
102
+ this.CHROM = f, this.POS = p === void 0 ? 0 : +p, this.ID = m === "." ? void 0 : m?.split(";"), this.REF = h, this.ALT = g === "." ? void 0 : g?.split(","), this.QUAL = _ === void 0 || _ === "." ? void 0 : +_, this.FILTER = y?.length === 1 && y[0] === "PASS" ? "PASS" : y, this.INFO = u[7] === void 0 || u[7] === "." ? {} : i(u[7], t), this.FORMAT = u[8], this.formatMeta = n, this.rest = d, this.sampleNames = r;
105
103
  }
106
104
  SAMPLES() {
107
105
  let e = {}, t = this.FORMAT;
@@ -131,10 +129,10 @@ var s = class {
131
129
  return e;
132
130
  }
133
131
  GENOTYPES() {
134
- return i(this.FORMAT ?? "", this.rest, this.sampleNames);
132
+ return n(this.FORMAT ?? "", this.rest, this.sampleNames);
135
133
  }
136
134
  processGenotypes(e) {
137
- r(this.FORMAT ?? "", this.rest, this.sampleNames.length, e);
135
+ t(this.FORMAT ?? "", this.rest, this.sampleNames.length, e);
138
136
  }
139
137
  toJSON() {
140
138
  return {
@@ -152,7 +150,7 @@ var s = class {
152
150
  };
153
151
  //#endregion
154
152
  //#region ../../node_modules/@gmod/vcf/esm/parseMetaString.js
155
- function c(e) {
153
+ function o(e) {
156
154
  let t = [], n = [], r = !1, i = !1, a = e.length;
157
155
  for (let o = 0; o < a; o++) {
158
156
  let a = e[o] ?? "";
@@ -160,29 +158,29 @@ function c(e) {
160
158
  }
161
159
  return n.length > 0 && t.push(n.join("").trim()), t;
162
160
  }
163
- function l(e, t) {
161
+ function s(e, t) {
164
162
  let n = e.indexOf(t);
165
163
  return [e.slice(0, n), e.slice(n + 1)];
166
164
  }
167
- function u(e) {
168
- let t = d(e), n = t.ID;
165
+ function c(e) {
166
+ let t = l(e), n = t.ID;
169
167
  if (delete t.ID, "Number" in t) {
170
168
  let e = Number(t.Number);
171
169
  Number.isNaN(e) || (t.Number = e);
172
170
  }
173
171
  return [n, t];
174
172
  }
175
- function d(e) {
176
- let t = c(e.slice(1, -1)), n = {};
173
+ function l(e) {
174
+ let t = o(e.slice(1, -1)), n = {};
177
175
  for (let e of t) {
178
- let [t, r] = l(e, "=");
176
+ let [t, r] = s(e, "=");
179
177
  r && r.startsWith("[") && r.endsWith("]") ? n[t] = r.slice(1, -1).split(",").map((e) => e.trim()) : r && r.startsWith("\"") && r.endsWith("\"") ? n[t] = r.slice(1, -1) : n[t] = r;
180
178
  }
181
179
  return n;
182
180
  }
183
181
  //#endregion
184
182
  //#region ../../node_modules/@gmod/vcf/esm/vcfReserved.js
185
- var f = {
183
+ var u = {
186
184
  InfoFields: {
187
185
  AA: {
188
186
  Number: 1,
@@ -491,7 +489,7 @@ var f = {
491
489
  "*": { Description: "Represents any possible alternative allele at this location" }
492
490
  },
493
491
  FilterTypes: { PASS: { Description: "Passed all filters" } }
494
- }, p = class {
492
+ }, d = class {
495
493
  metadata;
496
494
  strict;
497
495
  samples;
@@ -500,10 +498,10 @@ var f = {
500
498
  let n = e.split(/[\r\n]+/).filter(Boolean);
501
499
  if (!n.length) throw Error("no non-empty header lines specified");
502
500
  this.strict = t, this.metadata = {
503
- INFO: { ...f.InfoFields },
504
- FORMAT: { ...f.GenotypeFields },
505
- ALT: { ...f.AltTypes },
506
- FILTER: { ...f.FilterTypes }
501
+ INFO: { ...u.InfoFields },
502
+ FORMAT: { ...u.GenotypeFields },
503
+ ALT: { ...u.AltTypes },
504
+ FILTER: { ...u.FilterTypes }
507
505
  };
508
506
  let r;
509
507
  for (let e = 0; e < n.length; e++) {
@@ -531,7 +529,7 @@ var f = {
531
529
  if (!t) throw Error(`Line is not a valid metadata line: ${e}`);
532
530
  let n = t[1] ?? "", r = t[2];
533
531
  if (r?.startsWith("<")) {
534
- let e = this.metadata[n], t = e && typeof e == "object" ? e : {}, [i, a] = u(r);
532
+ let e = this.metadata[n], t = e && typeof e == "object" ? e : {}, [i, a] = c(r);
535
533
  typeof i == "string" ? (t[i] = a, this.metadata[n] = t) : this.metadata[n] = a;
536
534
  } else this.metadata[n] = r;
537
535
  }
@@ -541,8 +539,8 @@ var f = {
541
539
  return t;
542
540
  }
543
541
  parseLine(e) {
544
- return new s(e, this.metadata.INFO, this.metadata.FORMAT, this.samples, this.strict);
542
+ return new a(e, this.metadata.INFO, this.metadata.FORMAT, this.samples, this.strict);
545
543
  }
546
544
  };
547
545
  //#endregion
548
- export { p as default };
546
+ export { d as default };