@molgenis/vip-report-template 8.2.2 → 8.3.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/package.json +1 -1
- package/scripts/validateConfig/schema.ts +2 -0
- package/src/components/field/composed/FieldComposed.tsx +10 -0
- package/src/components/field/composed/FieldConfidenceInterval.tsx +14 -0
- package/src/components/field/composed/FieldGenotypeStr.tsx +4 -2
- package/src/components/field/composed/FieldSpanningReads.tsx +18 -0
- package/src/mocks/GRCh38/field_metadata.json +11 -13
- package/src/mocks/GRCh38/vcf/str.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/str.vcf +71 -238
- package/src/mocks/config_cram.json +9 -4
- package/src/mocks/config_default_values.json +6 -2
- package/src/mocks/config_vcf.json +4 -4
- package/src/types/config.d.ts +2 -0
- package/src/types/configCellComposed.d.ts +15 -3
- package/src/utils/config/configCellsComposed.ts +94 -19
- package/src/utils/config/configValidator.precompiled.ts +80 -0
- package/tests/utils/config/configCellsComposed.test.ts +70 -35
|
@@ -415,16 +415,16 @@
|
|
|
415
415
|
"label": "Father"
|
|
416
416
|
},
|
|
417
417
|
{
|
|
418
|
-
"type": "
|
|
419
|
-
"name": "
|
|
418
|
+
"type": "composed",
|
|
419
|
+
"name": "confidenceInterval"
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
422
|
"type": "genotype",
|
|
423
423
|
"name": "LC"
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
|
-
"type": "
|
|
427
|
-
"name": "
|
|
426
|
+
"type": "composed",
|
|
427
|
+
"name": "spanningReads"
|
|
428
428
|
},
|
|
429
429
|
{
|
|
430
430
|
"type": "info",
|
|
@@ -533,6 +533,11 @@
|
|
|
533
533
|
"type": "composed",
|
|
534
534
|
"name": "locus"
|
|
535
535
|
},
|
|
536
|
+
{
|
|
537
|
+
"type": "info",
|
|
538
|
+
"name": "CSQ/PICK",
|
|
539
|
+
"defaultValue": "true"
|
|
540
|
+
},
|
|
536
541
|
{
|
|
537
542
|
"type": "info",
|
|
538
543
|
"name": "CSQ/HPO",
|
|
@@ -413,13 +413,17 @@
|
|
|
413
413
|
"label": "Father"
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
|
-
"type": "
|
|
417
|
-
"name": "
|
|
416
|
+
"type": "composed",
|
|
417
|
+
"name": "confidenceInterval"
|
|
418
418
|
},
|
|
419
419
|
{
|
|
420
420
|
"type": "genotype",
|
|
421
421
|
"name": "LC"
|
|
422
422
|
},
|
|
423
|
+
{
|
|
424
|
+
"type": "composed",
|
|
425
|
+
"name": "spanningReads"
|
|
426
|
+
},
|
|
423
427
|
{
|
|
424
428
|
"type": "genotype",
|
|
425
429
|
"name": "ADSP"
|
|
@@ -413,16 +413,16 @@
|
|
|
413
413
|
"label": "Father"
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
|
-
"type": "
|
|
417
|
-
"name": "
|
|
416
|
+
"type": "composed",
|
|
417
|
+
"name": "confidenceInterval"
|
|
418
418
|
},
|
|
419
419
|
{
|
|
420
420
|
"type": "genotype",
|
|
421
421
|
"name": "LC"
|
|
422
422
|
},
|
|
423
423
|
{
|
|
424
|
-
"type": "
|
|
425
|
-
"name": "
|
|
424
|
+
"type": "composed",
|
|
425
|
+
"name": "spanningReads"
|
|
426
426
|
},
|
|
427
427
|
{
|
|
428
428
|
"type": "info",
|
package/src/types/config.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export interface ConfigJsonFieldComposed extends Describable {
|
|
|
34
34
|
type: "composed";
|
|
35
35
|
name:
|
|
36
36
|
| "clinVar"
|
|
37
|
+
| "confidenceInterval"
|
|
37
38
|
| "gene"
|
|
38
39
|
| "genotype"
|
|
39
40
|
| "genotype_maternal"
|
|
@@ -43,6 +44,7 @@ export interface ConfigJsonFieldComposed extends Describable {
|
|
|
43
44
|
| "inheritancePattern"
|
|
44
45
|
| "locus"
|
|
45
46
|
| "ref"
|
|
47
|
+
| "spanningReads"
|
|
46
48
|
| "vipC"
|
|
47
49
|
| "vipCS"
|
|
48
50
|
| "vkgl";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Genotype, InfoMetadata, ValueFlag, ValueFloat, ValueString } from "@molgenis/vip-report-vcf";
|
|
1
|
+
import { Genotype, InfoMetadata, ValueFlag, ValueFloat, ValueInteger, ValueString } from "@molgenis/vip-report-vcf";
|
|
2
2
|
import { ValueCategorical } from "../utils/vcf.ts";
|
|
3
3
|
|
|
4
4
|
export type CellValueClinVar = {
|
|
@@ -30,13 +30,23 @@ export type CellValueGenotype = {
|
|
|
30
30
|
altAlleles: (string | null)[];
|
|
31
31
|
genotype: Genotype;
|
|
32
32
|
svType: ValueString | undefined;
|
|
33
|
-
repeatCount: ValueString | undefined;
|
|
33
|
+
repeatCount: ValueString[] | undefined;
|
|
34
34
|
repeatUnitValue: ValueString | undefined;
|
|
35
|
-
repeatUnitMatch:
|
|
35
|
+
repeatUnitMatch: ValueInteger | undefined;
|
|
36
36
|
displayRepeatUnit: ValueString | undefined;
|
|
37
37
|
viab: number | null | undefined;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
export type CellValueConfidenceInterval = {
|
|
41
|
+
genotype: Genotype;
|
|
42
|
+
confidenceInterval: ValueString[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type CellValueSpanningReads = {
|
|
46
|
+
genotype: Genotype;
|
|
47
|
+
spanningReads: ValueInteger[];
|
|
48
|
+
};
|
|
49
|
+
|
|
40
50
|
export type CellValueHpo = {
|
|
41
51
|
hpos: ValueCategorical[];
|
|
42
52
|
gadoPd: ValueCategorical | undefined;
|
|
@@ -78,6 +88,8 @@ export type CellValueCustom =
|
|
|
78
88
|
| CellValueGene
|
|
79
89
|
| CellValueGnomAd
|
|
80
90
|
| CellValueGenotype
|
|
91
|
+
| CellValueConfidenceInterval
|
|
92
|
+
| CellValueSpanningReads
|
|
81
93
|
| CellValueHpo
|
|
82
94
|
| CellValueInheritanceModes
|
|
83
95
|
| CellValueLocus
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { ConfigCellCustom } from "../../types/configCells";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Genotype,
|
|
4
|
+
InfoMetadata,
|
|
5
|
+
ValueFlag,
|
|
6
|
+
ValueFloat,
|
|
7
|
+
ValueInteger,
|
|
8
|
+
ValueString,
|
|
9
|
+
VcfRecord,
|
|
10
|
+
} from "@molgenis/vip-report-vcf";
|
|
3
11
|
import { Item } from "@molgenis/vip-report-api";
|
|
4
12
|
import { getSampleLabel } from "../sample.ts";
|
|
5
13
|
import {
|
|
6
14
|
CellValueClinVar,
|
|
15
|
+
CellValueConfidenceInterval,
|
|
7
16
|
CellValueCustom,
|
|
8
17
|
CellValueGene,
|
|
9
18
|
CellValueGenotype,
|
|
@@ -11,6 +20,7 @@ import {
|
|
|
11
20
|
CellValueHpo,
|
|
12
21
|
CellValueInheritanceModes,
|
|
13
22
|
CellValueLocus,
|
|
23
|
+
CellValueSpanningReads,
|
|
14
24
|
CellValueVipC,
|
|
15
25
|
CellValueVipCS,
|
|
16
26
|
CellValueVkgl,
|
|
@@ -80,6 +90,12 @@ export function initConfigCellComposed(
|
|
|
80
90
|
case "vkgl":
|
|
81
91
|
fieldConfig = createConfigFieldCustomVkgl(configStatic, metadata.records);
|
|
82
92
|
break;
|
|
93
|
+
case "confidenceInterval":
|
|
94
|
+
fieldConfig = createConfigFieldCustomConfidenceInterval(configStatic, metadata.records, sample);
|
|
95
|
+
break;
|
|
96
|
+
case "spanningReads":
|
|
97
|
+
fieldConfig = createConfigFieldCustomSpanningReads(configStatic, metadata.records, sample);
|
|
98
|
+
break;
|
|
83
99
|
default:
|
|
84
100
|
throw new ConfigInvalidError(`unknown composed cell name '${id}'`);
|
|
85
101
|
}
|
|
@@ -201,16 +217,17 @@ function createConfigFieldCustomGenotypeForSample(
|
|
|
201
217
|
): ConfigCellCustom<CellValueGenotype> | null {
|
|
202
218
|
if (sample === null) return null;
|
|
203
219
|
|
|
204
|
-
const [fieldGt,
|
|
205
|
-
if (fieldGt === undefined) return null; // unlikely, but possible
|
|
206
|
-
|
|
207
|
-
const [fieldSvType, fieldRu, fieldRuMatch, fieldDisplayRu] = getInfoFields(
|
|
220
|
+
const [fieldGt, fieldViab, fieldRu, fieldRuMatch, fieldRepCn] = getSampleFields(
|
|
208
221
|
metadata,
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
"
|
|
222
|
+
"GT",
|
|
223
|
+
"VIAB",
|
|
224
|
+
"RU_CALL",
|
|
225
|
+
"RU_MATCH",
|
|
226
|
+
"RU_NR",
|
|
213
227
|
);
|
|
228
|
+
if (fieldGt === undefined) return null; // unlikely, but possible
|
|
229
|
+
|
|
230
|
+
const [fieldSvType, fieldDisplayRu] = getInfoFields(metadata, "SVTYPE", "DisplayRU");
|
|
214
231
|
|
|
215
232
|
return {
|
|
216
233
|
type: "composed",
|
|
@@ -219,23 +236,28 @@ function createConfigFieldCustomGenotypeForSample(
|
|
|
219
236
|
description: () => getDescription(config),
|
|
220
237
|
valueCount: () => 1,
|
|
221
238
|
value: (record: Item<VcfRecord>, valueIndex: number): CellValueGenotype => {
|
|
222
|
-
const [genotype,
|
|
239
|
+
const [genotype, viab, repeatUnitValue, repeatUnitMatch, repeatCount] = getSampleValues(
|
|
223
240
|
sample,
|
|
224
241
|
record,
|
|
225
242
|
valueIndex,
|
|
226
243
|
fieldGt,
|
|
227
|
-
fieldRepCn,
|
|
228
244
|
fieldViab,
|
|
229
|
-
) as [Genotype, ValueString | undefined, number | null | undefined];
|
|
230
|
-
|
|
231
|
-
const [svType, repeatUnitValue, repeatUnitMatch, displayRepeatUnit] = getInfoValues(
|
|
232
|
-
record,
|
|
233
|
-
valueIndex,
|
|
234
|
-
fieldSvType,
|
|
235
245
|
fieldRu,
|
|
236
246
|
fieldRuMatch,
|
|
237
|
-
|
|
238
|
-
) as [
|
|
247
|
+
fieldRepCn,
|
|
248
|
+
) as [
|
|
249
|
+
Genotype,
|
|
250
|
+
number | null | undefined,
|
|
251
|
+
ValueString | undefined,
|
|
252
|
+
ValueInteger | undefined,
|
|
253
|
+
ValueString[] | undefined,
|
|
254
|
+
];
|
|
255
|
+
|
|
256
|
+
const [svType, displayRepeatUnit] = getInfoValues(record, valueIndex, fieldSvType, fieldDisplayRu) as [
|
|
257
|
+
ValueString | undefined,
|
|
258
|
+
ValueString | undefined,
|
|
259
|
+
];
|
|
260
|
+
|
|
239
261
|
return {
|
|
240
262
|
refAllele: record.data.r,
|
|
241
263
|
altAlleles: record.data.a,
|
|
@@ -251,6 +273,59 @@ function createConfigFieldCustomGenotypeForSample(
|
|
|
251
273
|
};
|
|
252
274
|
}
|
|
253
275
|
|
|
276
|
+
function createConfigFieldCustomConfidenceInterval(
|
|
277
|
+
config: ConfigJsonFieldComposed,
|
|
278
|
+
metadata: VcfMetadataContainer,
|
|
279
|
+
sample: SampleContainer | null,
|
|
280
|
+
): ConfigCellCustom<CellValueConfidenceInterval> | null {
|
|
281
|
+
if (sample === null) return null;
|
|
282
|
+
const fieldGt = getSampleField(metadata, "GT");
|
|
283
|
+
const fieldCi = getSampleField(metadata, "RU_CI");
|
|
284
|
+
return {
|
|
285
|
+
type: "composed",
|
|
286
|
+
id: "confidenceInterval",
|
|
287
|
+
label: () => getLabel(config, "Confidence interval"),
|
|
288
|
+
description: () => getDescription(config, "Confidence interval for repeat unit count"),
|
|
289
|
+
valueCount: () => 1,
|
|
290
|
+
value: (record: Item<VcfRecord>, valueIndex: number): CellValueConfidenceInterval => {
|
|
291
|
+
const genotype = getSampleValue(sample, record, valueIndex, fieldGt) as Genotype;
|
|
292
|
+
const ci = getSampleValue(sample, record, valueIndex, fieldCi) as ValueString[];
|
|
293
|
+
|
|
294
|
+
return {
|
|
295
|
+
genotype: genotype,
|
|
296
|
+
confidenceInterval: ci !== undefined ? ci : [],
|
|
297
|
+
};
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function createConfigFieldCustomSpanningReads(
|
|
303
|
+
config: ConfigJsonFieldComposed,
|
|
304
|
+
metadata: VcfMetadataContainer,
|
|
305
|
+
sample: SampleContainer | null,
|
|
306
|
+
): ConfigCellCustom<CellValueSpanningReads> | null {
|
|
307
|
+
if (sample === null) return null;
|
|
308
|
+
const fieldGt = getSampleField(metadata, "GT");
|
|
309
|
+
const fieldSpan = getSampleField(metadata, "RU_SPAN");
|
|
310
|
+
return {
|
|
311
|
+
type: "composed",
|
|
312
|
+
id: "spanningReads",
|
|
313
|
+
label: () => getLabel(config, "Spanning Reads"),
|
|
314
|
+
description: () => getDescription(config, "Number of spanning reads for the genotype."),
|
|
315
|
+
valueCount: () => 1,
|
|
316
|
+
value: (record: Item<VcfRecord>, valueIndex: number): CellValueSpanningReads => {
|
|
317
|
+
console.log("here!");
|
|
318
|
+
const genotype = getSampleValue(sample, record, valueIndex, fieldGt) as Genotype;
|
|
319
|
+
const spanning = getSampleValue(sample, record, valueIndex, fieldSpan) as ValueInteger[];
|
|
320
|
+
|
|
321
|
+
return {
|
|
322
|
+
genotype: genotype,
|
|
323
|
+
spanningReads: spanning !== undefined ? spanning : [],
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
254
329
|
function createConfigFieldCustomGnomAd(
|
|
255
330
|
config: ConfigJsonFieldComposed,
|
|
256
331
|
metadata: VcfMetadataContainer,
|