@genome-spy/app 0.75.0 → 0.76.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-beUIcZcW.js +96 -0
- package/dist/agentApi-CzdacisO.js +25226 -0
- package/dist/agentApi.es.js +9460 -0
- package/dist/agentShared.es.js +4742 -0
- package/dist/{blosc-oa0DlI6G.js → blosc-BX4BJ8sR.js} +1 -1
- package/dist/componentStyles-CIXoKEp0.js +2182 -0
- package/dist/dialog.es.js +377 -0
- package/dist/{esm-n0auOe11.js → esm-BH0wx5y-.js} +1 -1
- package/dist/esm-BLfLaJtE.js +121 -0
- package/dist/{esm-D-WfYOx7.js → esm-BWsx1OJ2.js} +25 -25
- package/dist/{browser-Dvlo92rx.js → esm-BY4T8YoD.js} +38 -22
- package/dist/esm-CZvS2Ldm.js +155 -0
- package/dist/esm-CdIesJ1z.js +461 -0
- package/dist/{esm-DCCYNvaz.js → esm-Cr7pLUfG.js} +50 -50
- package/dist/esm-D-y0Ce1M.js +573 -0
- package/dist/esm-DHOMWRoL.js +1426 -0
- package/dist/{esm-Cmo4qEPr.js → esm-DJUb6vy0.js} +5 -5
- package/dist/esm-DPS6pYKF.js +1248 -0
- package/dist/esm-DRZ5LLNH.js +142 -0
- package/dist/esm-DjF6pKy5.js +369 -0
- package/dist/esm-PDPkTR1_.js +1015 -0
- package/dist/esm-s_SlArJ8.js +298 -0
- package/dist/index.es.js +7874 -28936
- package/dist/index.js +1127 -729
- package/dist/lit-ymUSmGBw.js +510 -0
- package/dist/{lz4-jZ0zyLBa.js → lz4-BSYl80V8.js} +1 -1
- package/dist/parquetRead-m8-8_SpH.js +1609 -0
- package/dist/schema.json +445 -85
- package/dist/style.css +1 -1
- package/dist/viewUtils-C5htqZCm.js +14147 -0
- package/dist/{zstd-C6ksIG9r.js → zstd-BAfRM3IH.js} +1 -1
- package/package.json +30 -5
- package/src/agentApi/index.d.ts +123 -0
- package/src/agentShared/index.d.ts +97 -0
- package/src/agentShared/types.d.ts +8 -0
- package/src/appTypes.d.ts +75 -0
- package/src/bookmark/databaseSchema.d.ts +33 -0
- package/src/charts/boxplotTypes.d.ts +15 -0
- package/src/charts/sampleAttributePlotTypes.d.ts +149 -0
- package/src/coreSpecAugmentation.d.ts +29 -0
- package/src/dialog/index.d.ts +5 -0
- package/src/embedTypes.d.ts +9 -0
- package/src/index.d.ts +16 -0
- package/src/sampleView/sampleViewTypes.d.ts +174 -0
- package/src/sampleView/state/payloadTypes.d.ts +400 -0
- package/src/sampleView/state/sampleState.d.ts +76 -0
- package/src/sampleView/types.d.ts +125 -0
- package/src/spec/appSpec.d.ts +54 -0
- package/src/spec/sampleView.d.ts +487 -0
- package/src/spec/view.d.ts +124 -0
- package/src/state/paramProvenanceTypes.d.ts +215 -0
- package/src/state/selectionExpansionTypes.d.ts +77 -0
- package/src/state.d.ts +97 -0
- package/src/types/lz-string.d.ts +24 -0
- package/src/types/vega-loader.d.ts +1 -0
- package/src/utils/colorScaleSummary.d.ts +15 -0
- package/src/utils/statistics/fieldSummary.d.ts +49 -0
- package/src/vite-env.d.ts +6 -0
- package/LICENSE +0 -21
- /package/dist/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BDH1cqFl.js} +0 -0
- /package/dist/{chunk-INHXZS53-fPMmEwMt.js → chunk-INHXZS53-DwEV9sMh.js} +0 -0
- /package/dist/{esm-BygJiwh0.js → esm-BL9SNSnj.js} +0 -0
- /package/dist/{esm-B8-vSu-c.js → esm-BwW--bVV.js} +0 -0
- /package/dist/{esm-CGX-qz1d.js → esm-Bz_92nH0.js} +0 -0
- /package/dist/{esm-CuMSzCHy.js → esm-D2_c7lXY.js} +0 -0
- /package/dist/{parquetRead-CJe1UPsz.js → parquetRead-BuEN-6yG.js} +0 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
//#region ../../node_modules/@gmod/vcf/esm/parseGenotypesOnly.js
|
|
2
|
+
function e(e, t, n) {
|
|
3
|
+
let r = Object.create(null), i = n.length, a = t.length, o = 0;
|
|
4
|
+
if (e === "GT") {
|
|
5
|
+
for (let e = 0; e < i; e++) {
|
|
6
|
+
let i = o;
|
|
7
|
+
for (; o < a && t.charCodeAt(o) !== 9;) o++;
|
|
8
|
+
r[n[e]] = t.slice(i, o), o++;
|
|
9
|
+
}
|
|
10
|
+
return r;
|
|
11
|
+
}
|
|
12
|
+
let s = e.indexOf("GT");
|
|
13
|
+
if (s === -1) return r;
|
|
14
|
+
if (s === 0) {
|
|
15
|
+
for (let e = 0; e < i; e++) {
|
|
16
|
+
let i = o;
|
|
17
|
+
for (; o < a && t.charCodeAt(o) !== 58 && t.charCodeAt(o) !== 9;) o++;
|
|
18
|
+
for (r[n[e]] = t.slice(i, o); o < a && t.charCodeAt(o) !== 9;) o++;
|
|
19
|
+
o++;
|
|
20
|
+
}
|
|
21
|
+
return r;
|
|
22
|
+
}
|
|
23
|
+
let c = 0;
|
|
24
|
+
for (let t = 0; t < s; t++) e.charCodeAt(t) === 58 && c++;
|
|
25
|
+
for (let e = 0; e < i; e++) {
|
|
26
|
+
let i = o, s = o;
|
|
27
|
+
for (; s < a && t.charCodeAt(s) !== 9;) s++;
|
|
28
|
+
let l = 0, u = i;
|
|
29
|
+
for (let a = i; a <= s; a++) if (a === s || t.charCodeAt(a) === 58) {
|
|
30
|
+
if (l === c) {
|
|
31
|
+
r[n[e]] = t.slice(u, a);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
l++, u = a + 1;
|
|
35
|
+
}
|
|
36
|
+
o = s + 1;
|
|
37
|
+
}
|
|
38
|
+
return r;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region ../../node_modules/@gmod/vcf/esm/processGenotypes.js
|
|
42
|
+
function t(e, t, n, r) {
|
|
43
|
+
let i = t.length, a = 0;
|
|
44
|
+
if (e === "GT") {
|
|
45
|
+
for (let e = 0; e < n; e++) {
|
|
46
|
+
let e = a;
|
|
47
|
+
for (; a < i && t.charCodeAt(a) !== 9;) a++;
|
|
48
|
+
r(t, e, a), a++;
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let o = e.indexOf("GT");
|
|
53
|
+
if (o === -1) return;
|
|
54
|
+
if (o === 0) {
|
|
55
|
+
for (let e = 0; e < n; e++) {
|
|
56
|
+
let e = a;
|
|
57
|
+
for (; a < i && t.charCodeAt(a) !== 58 && t.charCodeAt(a) !== 9;) a++;
|
|
58
|
+
for (r(t, e, a); a < i && t.charCodeAt(a) !== 9;) a++;
|
|
59
|
+
a++;
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let s = 0;
|
|
64
|
+
for (let t = 0; t < o; t++) e.charCodeAt(t) === 58 && s++;
|
|
65
|
+
for (let e = 0; e < n; e++) {
|
|
66
|
+
let e = a, n = a;
|
|
67
|
+
for (; n < i && t.charCodeAt(n) !== 9;) n++;
|
|
68
|
+
let o = 0, c = e;
|
|
69
|
+
for (let i = e; i <= n; i++) if (i === n || t.charCodeAt(i) === 58) {
|
|
70
|
+
if (o === s) {
|
|
71
|
+
r(t, c, i);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
o++, c = i + 1;
|
|
75
|
+
}
|
|
76
|
+
a = n + 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region ../../node_modules/@gmod/vcf/esm/Variant.js
|
|
81
|
+
function n(e) {
|
|
82
|
+
try {
|
|
83
|
+
return decodeURIComponent(e);
|
|
84
|
+
} catch {
|
|
85
|
+
return e;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
var r = class {
|
|
89
|
+
constructor(e, t, n, r, i) {
|
|
90
|
+
let a = 0, o = 0;
|
|
91
|
+
for (; a < e.length && o < 9;) e[a] === " " && (o += 1), a += 1;
|
|
92
|
+
let s = o === 9 ? a - 1 : a, c = e.slice(0, s).split(" "), l = e.slice(s + 1), [u, d, f, p, m, h, g] = c, _ = g === "." ? void 0 : g.split(";");
|
|
93
|
+
if (i && !c[7]) throw Error("no INFO field specified, must contain at least a '.' (turn off strict mode to allow)");
|
|
94
|
+
this.CHROM = u, this.POS = +d, this.ID = f === "." ? void 0 : f.split(";"), this.REF = p, this.ALT = m === "." ? void 0 : m.split(","), this.QUAL = h === "." ? void 0 : +h, this.FILTER = _?.length === 1 && _[0] === "PASS" ? "PASS" : _, this.INFO = c[7] === void 0 || c[7] === "." ? {} : this.parseInfo(c[7], t), this.FORMAT = c[8], this.formatMeta = n, this.rest = l, this.sampleNames = r;
|
|
95
|
+
}
|
|
96
|
+
parseInfo(e, t) {
|
|
97
|
+
let r = {}, i = e.includes("%"), a = e.split(";"), o = a.length;
|
|
98
|
+
for (let e = 0; e < o; e++) {
|
|
99
|
+
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;
|
|
100
|
+
if (u === "Flag") r[c] = !0;
|
|
101
|
+
else if (!l) r[c] = !0;
|
|
102
|
+
else {
|
|
103
|
+
let e = u === "Integer" || u === "Float", t = l.split(","), a = t.length;
|
|
104
|
+
if (i) {
|
|
105
|
+
let i = [];
|
|
106
|
+
for (let r = 0; r < a; r++) {
|
|
107
|
+
let a = t[r];
|
|
108
|
+
if (a === ".") i.push(void 0);
|
|
109
|
+
else {
|
|
110
|
+
let t = n(a);
|
|
111
|
+
i.push(e ? Number(t) : t);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
r[c] = i;
|
|
115
|
+
} else {
|
|
116
|
+
let n = [];
|
|
117
|
+
for (let r = 0; r < a; r++) {
|
|
118
|
+
let i = t[r];
|
|
119
|
+
i === "." ? n.push(void 0) : n.push(e ? Number(i) : i);
|
|
120
|
+
}
|
|
121
|
+
r[c] = n;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return r;
|
|
126
|
+
}
|
|
127
|
+
SAMPLES() {
|
|
128
|
+
let e = {}, t = this.FORMAT;
|
|
129
|
+
if (t) {
|
|
130
|
+
let n = this.rest.split(" "), r = t.split(":"), i = [];
|
|
131
|
+
for (let e = 0; e < r.length; e++) {
|
|
132
|
+
let t = this.formatMeta[r[e]]?.Type;
|
|
133
|
+
i.push(t === "Integer" || t === "Float");
|
|
134
|
+
}
|
|
135
|
+
let a = r.length, o = this.sampleNames.length;
|
|
136
|
+
for (let t = 0; t < o; t++) {
|
|
137
|
+
let o = this.sampleNames[t], s = {}, c = n[t], l = c.length, u = 0, d = 0;
|
|
138
|
+
for (let e = 0; e <= l; e++) if (e === l || c[e] === ":") {
|
|
139
|
+
let t = c.slice(u, e);
|
|
140
|
+
if (t === "" || t === ".") s[r[d]] = void 0;
|
|
141
|
+
else {
|
|
142
|
+
let e = t.split(","), n = [];
|
|
143
|
+
if (i[d]) for (let t = 0; t < e.length; t++) {
|
|
144
|
+
let r = e[t];
|
|
145
|
+
n.push(r === "." ? void 0 : +r);
|
|
146
|
+
}
|
|
147
|
+
else for (let t = 0; t < e.length; t++) {
|
|
148
|
+
let r = e[t];
|
|
149
|
+
n.push(r === "." ? void 0 : r);
|
|
150
|
+
}
|
|
151
|
+
s[r[d]] = n;
|
|
152
|
+
}
|
|
153
|
+
if (u = e + 1, d += 1, d >= a) break;
|
|
154
|
+
}
|
|
155
|
+
e[o] = s;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return e;
|
|
159
|
+
}
|
|
160
|
+
GENOTYPES() {
|
|
161
|
+
return e(this.FORMAT ?? "", this.rest, this.sampleNames);
|
|
162
|
+
}
|
|
163
|
+
processGenotypes(e) {
|
|
164
|
+
t(this.FORMAT ?? "", this.rest, this.sampleNames.length, e);
|
|
165
|
+
}
|
|
166
|
+
toJSON() {
|
|
167
|
+
return {
|
|
168
|
+
CHROM: this.CHROM,
|
|
169
|
+
POS: this.POS,
|
|
170
|
+
ID: this.ID,
|
|
171
|
+
REF: this.REF,
|
|
172
|
+
ALT: this.ALT,
|
|
173
|
+
QUAL: this.QUAL,
|
|
174
|
+
FILTER: this.FILTER,
|
|
175
|
+
INFO: this.INFO,
|
|
176
|
+
FORMAT: this.FORMAT
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region ../../node_modules/@gmod/vcf/esm/parseMetaString.js
|
|
182
|
+
function i(e) {
|
|
183
|
+
let t = [], n = [], r = !1, i = !1, a = e.length;
|
|
184
|
+
for (let o = 0; o < a; o++) {
|
|
185
|
+
let a = e[o];
|
|
186
|
+
a === "\"" ? (r = !r, n.push(a)) : a === "[" ? (i = !0, n.push(a)) : a === "]" ? (i = !1, n.push(a)) : a === "," && !r && !i ? (t.push(n.join("").trim()), n.length = 0) : n.push(a);
|
|
187
|
+
}
|
|
188
|
+
return n.length > 0 && t.push(n.join("").trim()), t;
|
|
189
|
+
}
|
|
190
|
+
function a(e, t) {
|
|
191
|
+
let n = e.indexOf(t);
|
|
192
|
+
return [e.slice(0, n), e.slice(n + 1)];
|
|
193
|
+
}
|
|
194
|
+
function o(e) {
|
|
195
|
+
let t = i(e.slice(1, -1)), n = [];
|
|
196
|
+
for (let e = 0; e < t.length; e++) {
|
|
197
|
+
let r = t[e], [i, o] = a(r, "=");
|
|
198
|
+
if (o && o.startsWith("[") && o.endsWith("]")) {
|
|
199
|
+
let e = o.slice(1, -1).split(",");
|
|
200
|
+
for (let t = 0; t < e.length; t++) e[t] = e[t].trim();
|
|
201
|
+
n.push([i, e]);
|
|
202
|
+
} else o && o.startsWith("\"") && o.endsWith("\"") ? n.push([i, o.slice(1, -1)]) : n.push([i, o]);
|
|
203
|
+
}
|
|
204
|
+
return Object.fromEntries(n);
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region ../../node_modules/@gmod/vcf/esm/vcfReserved.js
|
|
208
|
+
var s = {
|
|
209
|
+
InfoFields: {
|
|
210
|
+
AA: {
|
|
211
|
+
Number: 1,
|
|
212
|
+
Type: "String",
|
|
213
|
+
Description: "Ancestral allele"
|
|
214
|
+
},
|
|
215
|
+
AC: {
|
|
216
|
+
Number: "A",
|
|
217
|
+
Type: "Integer",
|
|
218
|
+
Description: "Allele count in genotypes, for each ALT allele, in the same order as listed"
|
|
219
|
+
},
|
|
220
|
+
AD: {
|
|
221
|
+
Number: "R",
|
|
222
|
+
Type: "Integer",
|
|
223
|
+
Description: "Total read depth for each allele"
|
|
224
|
+
},
|
|
225
|
+
ADF: {
|
|
226
|
+
Number: "R",
|
|
227
|
+
Type: "Integer",
|
|
228
|
+
Description: "Read depth for each allele on the forward strand"
|
|
229
|
+
},
|
|
230
|
+
ADR: {
|
|
231
|
+
Number: "R",
|
|
232
|
+
Type: "Integer",
|
|
233
|
+
Description: "Read depth for each allele on the reverse strand"
|
|
234
|
+
},
|
|
235
|
+
AF: {
|
|
236
|
+
Number: "A",
|
|
237
|
+
Type: "Float",
|
|
238
|
+
Description: "Allele frequency for each ALT allele in the same order as listed (estimated from primary data, not called genotypes)"
|
|
239
|
+
},
|
|
240
|
+
AN: {
|
|
241
|
+
Number: 1,
|
|
242
|
+
Type: "Integer",
|
|
243
|
+
Description: "Total number of alleles in called genotypes"
|
|
244
|
+
},
|
|
245
|
+
BQ: {
|
|
246
|
+
Number: 1,
|
|
247
|
+
Type: "Float",
|
|
248
|
+
Description: "RMS base quality"
|
|
249
|
+
},
|
|
250
|
+
CIGAR: {
|
|
251
|
+
Number: 1,
|
|
252
|
+
Type: "Float",
|
|
253
|
+
Description: "Cigar string describing how to align an alternate allele to the reference allele"
|
|
254
|
+
},
|
|
255
|
+
DB: {
|
|
256
|
+
Number: 0,
|
|
257
|
+
Type: "Flag",
|
|
258
|
+
Description: "dbSNP membership"
|
|
259
|
+
},
|
|
260
|
+
DP: {
|
|
261
|
+
Number: 1,
|
|
262
|
+
Type: "Integer",
|
|
263
|
+
Description: "combined depth across samples"
|
|
264
|
+
},
|
|
265
|
+
END: {
|
|
266
|
+
Number: 1,
|
|
267
|
+
Type: "Integer",
|
|
268
|
+
Description: "End position (for use with symbolic alleles)"
|
|
269
|
+
},
|
|
270
|
+
H2: {
|
|
271
|
+
Number: 0,
|
|
272
|
+
Type: "Flag",
|
|
273
|
+
Description: "HapMap2 membership"
|
|
274
|
+
},
|
|
275
|
+
H3: {
|
|
276
|
+
Number: 0,
|
|
277
|
+
Type: "Flag",
|
|
278
|
+
Description: "HapMap3 membership"
|
|
279
|
+
},
|
|
280
|
+
MQ: {
|
|
281
|
+
Number: 1,
|
|
282
|
+
Type: null,
|
|
283
|
+
Description: "RMS mapping quality"
|
|
284
|
+
},
|
|
285
|
+
MQ0: {
|
|
286
|
+
Number: 1,
|
|
287
|
+
Type: "Integer",
|
|
288
|
+
Description: "Number of MAPQ == 0 reads"
|
|
289
|
+
},
|
|
290
|
+
NS: {
|
|
291
|
+
Number: 1,
|
|
292
|
+
Type: "Integer",
|
|
293
|
+
Description: "Number of samples with data"
|
|
294
|
+
},
|
|
295
|
+
SB: {
|
|
296
|
+
Number: 4,
|
|
297
|
+
Type: "Integer",
|
|
298
|
+
Description: "Strand bias"
|
|
299
|
+
},
|
|
300
|
+
SOMATIC: {
|
|
301
|
+
Number: 0,
|
|
302
|
+
Type: "Flag",
|
|
303
|
+
Description: "Somatic mutation (for cancer genomics)"
|
|
304
|
+
},
|
|
305
|
+
VALIDATED: {
|
|
306
|
+
Number: 0,
|
|
307
|
+
Type: "Flag",
|
|
308
|
+
Description: "Validated by follow-up experiment"
|
|
309
|
+
},
|
|
310
|
+
"1000G": {
|
|
311
|
+
Number: 0,
|
|
312
|
+
Type: "Flag",
|
|
313
|
+
Description: "1000 Genomes membership"
|
|
314
|
+
},
|
|
315
|
+
IMPRECISE: {
|
|
316
|
+
Number: 0,
|
|
317
|
+
Type: "Flag",
|
|
318
|
+
Description: "Imprecise structural variation"
|
|
319
|
+
},
|
|
320
|
+
NOVEL: {
|
|
321
|
+
Number: 0,
|
|
322
|
+
Type: "Flag",
|
|
323
|
+
Description: "Indicates a novel structural variation"
|
|
324
|
+
},
|
|
325
|
+
SVTYPE: {
|
|
326
|
+
Number: 1,
|
|
327
|
+
Type: "String",
|
|
328
|
+
Description: "Type of structural variant"
|
|
329
|
+
},
|
|
330
|
+
SVLEN: {
|
|
331
|
+
Number: null,
|
|
332
|
+
Type: "Integer",
|
|
333
|
+
Description: "Difference in length between REF and ALT alleles"
|
|
334
|
+
},
|
|
335
|
+
CIPOS: {
|
|
336
|
+
Number: 2,
|
|
337
|
+
Type: "Integer",
|
|
338
|
+
Description: "Confidence interval around POS for imprecise variants"
|
|
339
|
+
},
|
|
340
|
+
CIEND: {
|
|
341
|
+
Number: 2,
|
|
342
|
+
Type: "Integer",
|
|
343
|
+
Description: "Confidence interval around END for imprecise variants"
|
|
344
|
+
},
|
|
345
|
+
HOMLEN: {
|
|
346
|
+
Type: "Integer",
|
|
347
|
+
Description: "Length of base pair identical micro-homology at event breakpoints"
|
|
348
|
+
},
|
|
349
|
+
HOMSEQ: {
|
|
350
|
+
Type: "String",
|
|
351
|
+
Description: "Sequence of base pair identical micro-homology at event breakpoints"
|
|
352
|
+
},
|
|
353
|
+
BKPTID: {
|
|
354
|
+
Type: "String",
|
|
355
|
+
Description: "ID of the assembled alternate allele in the assembly file"
|
|
356
|
+
},
|
|
357
|
+
MEINFO: {
|
|
358
|
+
Number: 4,
|
|
359
|
+
Type: "String",
|
|
360
|
+
Description: "Mobile element info of the form NAME,START,END,POLARITY"
|
|
361
|
+
},
|
|
362
|
+
METRANS: {
|
|
363
|
+
Number: 4,
|
|
364
|
+
Type: "String",
|
|
365
|
+
Description: "Mobile element transduction info of the form CHR,START,END,POLARITY"
|
|
366
|
+
},
|
|
367
|
+
DGVID: {
|
|
368
|
+
Number: 1,
|
|
369
|
+
Type: "String",
|
|
370
|
+
Description: "ID of this element in Database of Genomic Variation"
|
|
371
|
+
},
|
|
372
|
+
DBVARID: {
|
|
373
|
+
Number: 1,
|
|
374
|
+
Type: "String",
|
|
375
|
+
Description: "ID of this element in DBVAR"
|
|
376
|
+
},
|
|
377
|
+
DBRIPID: {
|
|
378
|
+
Number: 1,
|
|
379
|
+
Type: "String",
|
|
380
|
+
Description: "ID of this element in DBRIP"
|
|
381
|
+
},
|
|
382
|
+
MATEID: {
|
|
383
|
+
Number: null,
|
|
384
|
+
Type: "String",
|
|
385
|
+
Description: "ID of mate breakends"
|
|
386
|
+
},
|
|
387
|
+
PARID: {
|
|
388
|
+
Number: 1,
|
|
389
|
+
Type: "String",
|
|
390
|
+
Description: "ID of partner breakend"
|
|
391
|
+
},
|
|
392
|
+
EVENT: {
|
|
393
|
+
Number: 1,
|
|
394
|
+
Type: "String",
|
|
395
|
+
Description: "ID of event associated to breakend"
|
|
396
|
+
},
|
|
397
|
+
CILEN: {
|
|
398
|
+
Number: 2,
|
|
399
|
+
Type: "Integer",
|
|
400
|
+
Description: "Confidence interval around the inserted material between breakend"
|
|
401
|
+
},
|
|
402
|
+
DPADJ: {
|
|
403
|
+
Type: "Integer",
|
|
404
|
+
Description: "Read Depth of adjacency"
|
|
405
|
+
},
|
|
406
|
+
CN: {
|
|
407
|
+
Number: 1,
|
|
408
|
+
Type: "Integer",
|
|
409
|
+
Description: "Copy number of segment containing breakend"
|
|
410
|
+
},
|
|
411
|
+
CNADJ: {
|
|
412
|
+
Number: null,
|
|
413
|
+
Type: "Integer",
|
|
414
|
+
Description: "Copy number of adjacency"
|
|
415
|
+
},
|
|
416
|
+
CICN: {
|
|
417
|
+
Number: 2,
|
|
418
|
+
Type: "Integer",
|
|
419
|
+
Description: "Confidence interval around copy number for the segment"
|
|
420
|
+
},
|
|
421
|
+
CICNADJ: {
|
|
422
|
+
Number: null,
|
|
423
|
+
Type: "Integer",
|
|
424
|
+
Description: "Confidence interval around copy number for the adjacency"
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
GenotypeFields: {
|
|
428
|
+
AD: {
|
|
429
|
+
Number: "R",
|
|
430
|
+
Type: "Integer",
|
|
431
|
+
Description: "Read depth for each allele"
|
|
432
|
+
},
|
|
433
|
+
ADF: {
|
|
434
|
+
Number: "R",
|
|
435
|
+
Type: "Integer",
|
|
436
|
+
Description: "Read depth for each allele on the forward strand"
|
|
437
|
+
},
|
|
438
|
+
ADR: {
|
|
439
|
+
Number: "R",
|
|
440
|
+
Type: "Integer",
|
|
441
|
+
Description: "Read depth for each allele on the reverse strand"
|
|
442
|
+
},
|
|
443
|
+
DP: {
|
|
444
|
+
Number: 1,
|
|
445
|
+
Type: "Integer",
|
|
446
|
+
Description: "Read depth"
|
|
447
|
+
},
|
|
448
|
+
EC: {
|
|
449
|
+
Number: "A",
|
|
450
|
+
Type: "Integer",
|
|
451
|
+
Description: "Expected alternate allele counts"
|
|
452
|
+
},
|
|
453
|
+
FT: {
|
|
454
|
+
Number: 1,
|
|
455
|
+
Type: "String",
|
|
456
|
+
Description: "Filter indicating if this genotype was \"called\""
|
|
457
|
+
},
|
|
458
|
+
GL: {
|
|
459
|
+
Number: "G",
|
|
460
|
+
Type: "Float",
|
|
461
|
+
Description: "Genotype likelihoods"
|
|
462
|
+
},
|
|
463
|
+
GP: {
|
|
464
|
+
Number: "G",
|
|
465
|
+
Type: "Float",
|
|
466
|
+
Description: "Genotype posterior probabilities"
|
|
467
|
+
},
|
|
468
|
+
GQ: {
|
|
469
|
+
Number: 1,
|
|
470
|
+
Type: "Integer",
|
|
471
|
+
Description: "Conditional genotype quality"
|
|
472
|
+
},
|
|
473
|
+
GT: {
|
|
474
|
+
Number: 1,
|
|
475
|
+
Type: "String",
|
|
476
|
+
Description: "Genotype"
|
|
477
|
+
},
|
|
478
|
+
HQ: {
|
|
479
|
+
Number: 2,
|
|
480
|
+
Type: "Integer",
|
|
481
|
+
Description: "Haplotype quality"
|
|
482
|
+
},
|
|
483
|
+
MQ: {
|
|
484
|
+
Number: 1,
|
|
485
|
+
Type: "Integer",
|
|
486
|
+
Description: "RMS mapping quality"
|
|
487
|
+
},
|
|
488
|
+
PL: {
|
|
489
|
+
Number: "G",
|
|
490
|
+
Type: "Integer",
|
|
491
|
+
Description: "Phred-scaled genotype likelihoods rounded to the closest integer"
|
|
492
|
+
},
|
|
493
|
+
PQ: {
|
|
494
|
+
Number: 1,
|
|
495
|
+
Type: "Integer",
|
|
496
|
+
Description: "Phasing quality"
|
|
497
|
+
},
|
|
498
|
+
PS: {
|
|
499
|
+
Number: 1,
|
|
500
|
+
Type: "Integer",
|
|
501
|
+
Description: "Phase set"
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
AltTypes: {
|
|
505
|
+
DEL: { Description: "Deletion relative to the reference" },
|
|
506
|
+
INS: { Description: "Insertion of novel sequence relative to the reference" },
|
|
507
|
+
DUP: { Description: "Region of elevated copy number relative to the reference" },
|
|
508
|
+
INV: { Description: "Inversion of reference sequence" },
|
|
509
|
+
CNV: { Description: "Copy number variable region (may be both deletion and duplication)" },
|
|
510
|
+
"DUP:TANDEM": { Description: "Tandem duplication" },
|
|
511
|
+
"DEL:ME": { Description: "Deletion of mobile element relative to the reference" },
|
|
512
|
+
"INS:ME": { Description: "Insertion of a mobile element relative to the reference" },
|
|
513
|
+
NON_REF: { Description: "Represents any possible alternative allele at this location" },
|
|
514
|
+
"*": { Description: "Represents any possible alternative allele at this location" }
|
|
515
|
+
},
|
|
516
|
+
FilterTypes: { PASS: { Description: "Passed all filters" } }
|
|
517
|
+
}, c = class {
|
|
518
|
+
constructor({ header: e, strict: t = !0 }) {
|
|
519
|
+
if (!e.length) throw Error("empty header received");
|
|
520
|
+
let n = e.split(/[\r\n]+/).filter(Boolean);
|
|
521
|
+
if (!n.length) throw Error("no non-empty header lines specified");
|
|
522
|
+
this.strict = t, this.metadata = {
|
|
523
|
+
INFO: { ...s.InfoFields },
|
|
524
|
+
FORMAT: { ...s.GenotypeFields },
|
|
525
|
+
ALT: { ...s.AltTypes },
|
|
526
|
+
FILTER: { ...s.FilterTypes }
|
|
527
|
+
};
|
|
528
|
+
let r;
|
|
529
|
+
for (let e = 0; e < n.length; e++) {
|
|
530
|
+
let t = n[e];
|
|
531
|
+
if (t.startsWith("#")) t.startsWith("##") ? this.parseMetadata(t) : r = t;
|
|
532
|
+
else throw Error(`Bad line in header:\n${t}`);
|
|
533
|
+
}
|
|
534
|
+
if (!r) throw Error("No format line found in header");
|
|
535
|
+
let i = r.trim().split(" "), a = i.slice(0, 8), o = [
|
|
536
|
+
"#CHROM",
|
|
537
|
+
"POS",
|
|
538
|
+
"ID",
|
|
539
|
+
"REF",
|
|
540
|
+
"ALT",
|
|
541
|
+
"QUAL",
|
|
542
|
+
"FILTER",
|
|
543
|
+
"INFO"
|
|
544
|
+
];
|
|
545
|
+
if (i.length < 8) throw Error(`VCF header missing columns:\n${r}`);
|
|
546
|
+
if (a.length !== o.length || !a.every((e, t) => e === o[t])) throw Error(`VCF column headers not correct:\n${r}`);
|
|
547
|
+
this.samples = i.slice(9);
|
|
548
|
+
}
|
|
549
|
+
parseMetadata(e) {
|
|
550
|
+
let t = /^##(.+?)=(.*)/.exec(e.trim());
|
|
551
|
+
if (!t) throw Error(`Line is not a valid metadata line: ${e}`);
|
|
552
|
+
let [n, r] = t.slice(1, 3), i = n;
|
|
553
|
+
if (r?.startsWith("<")) {
|
|
554
|
+
i in this.metadata || (this.metadata[i] = {});
|
|
555
|
+
let [e, t] = this.parseStructuredMetaVal(r);
|
|
556
|
+
e ? this.metadata[i][e] = t : this.metadata[i] = t;
|
|
557
|
+
} else this.metadata[i] = r;
|
|
558
|
+
}
|
|
559
|
+
parseStructuredMetaVal(e) {
|
|
560
|
+
let t = o(e), n = t.ID;
|
|
561
|
+
return delete t.ID, "Number" in t && (Number.isNaN(Number(t.Number)) || (t.Number = Number(t.Number))), [n, t];
|
|
562
|
+
}
|
|
563
|
+
getMetadata(...e) {
|
|
564
|
+
let t = this.metadata, n = e.length;
|
|
565
|
+
for (let r = 0; r < n; r++) if (t = t[e[r]], !t) return t;
|
|
566
|
+
return t;
|
|
567
|
+
}
|
|
568
|
+
parseLine(e) {
|
|
569
|
+
return new r(e, this.metadata.INFO, this.metadata.FORMAT, this.samples, this.strict);
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
//#endregion
|
|
573
|
+
export { c as default };
|