@molgenis/vip-report-template 7.1.2 → 8.0.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/.gitattributes +3 -1
- package/.travis.yml +1 -0
- package/README.md +13 -0
- package/eslint.config.mjs +6 -1
- package/package.json +6 -5
- package/scripts/validateConfig/README.txt +5 -0
- package/scripts/validateConfig/compileValidator.ts +17 -0
- package/scripts/validateConfig/createSchema.ts +6 -0
- package/scripts/validateConfig/schema.ts +370 -0
- package/src/App.tsx +2 -1
- package/src/components/DatasetDropdown.tsx +1 -1
- package/src/components/GenomeBrowser.tsx +14 -4
- package/src/components/RecordsTable.tsx +23 -6
- package/src/components/VariantConsequenceContainer.tsx +9 -2
- package/src/components/VariantInfoTable.tsx +1 -1
- package/src/components/VariantsContainer.tsx +47 -9
- package/src/components/VariantsContainerHeader.tsx +1 -8
- package/src/components/field/composed/FieldGenotype.tsx +1 -1
- package/src/components/field/composed/FieldGenotypeStr.tsx +18 -10
- package/src/components/field/composed/FieldGnomAd.tsx +1 -1
- package/src/components/field/composed/FieldInheritanceModes.tsx +1 -4
- package/src/components/field/composed/FieldVkgl.tsx +1 -1
- package/src/components/field/typed/FieldCategorical.tsx +1 -1
- package/src/components/field/typed/FieldCharacter.tsx +1 -1
- package/src/components/field/typed/FieldFlag.tsx +1 -1
- package/src/components/field/typed/FieldFloat.tsx +1 -1
- package/src/components/field/typed/FieldInteger.tsx +1 -1
- package/src/components/field/typed/FieldString.tsx +1 -1
- package/src/components/filter/Filter.tsx +1 -0
- package/src/components/filter/composed/FilterAllelicImbalance.tsx +1 -0
- package/src/components/filter/composed/FilterComposed.tsx +7 -0
- package/src/components/filter/composed/FilterDeNovo.tsx +1 -0
- package/src/components/filter/composed/FilterHpo.tsx +1 -0
- package/src/components/filter/composed/FilterInheritance.tsx +1 -0
- package/src/components/filter/composed/FilterLocus.tsx +17 -3
- package/src/components/filter/composed/FilterPick.tsx +30 -0
- package/src/components/filter/composed/FilterVipC.tsx +1 -0
- package/src/components/filter/composed/FilterVipCS.tsx +1 -0
- package/src/components/filter/fixed/FilterFixed.tsx +7 -0
- package/src/components/filter/typed/FilterCategorical.tsx +18 -1
- package/src/components/filter/typed/FilterFlag.tsx +2 -0
- package/src/components/filter/typed/FilterInterval.tsx +29 -1
- package/src/components/filter/typed/FilterString.tsx +8 -1
- package/src/components/filter/typed/FilterTyped.tsx +1 -0
- package/src/components/form/ButtonApply.tsx +6 -2
- package/src/mocks/GRCh38/README.txt +15 -0
- package/src/mocks/GRCh38/decisionTree.json +201 -0
- package/src/mocks/GRCh38/family.ped +6 -0
- package/src/mocks/GRCh38/field_metadata.json +36 -11
- package/src/mocks/GRCh38/sample1.ped +1 -0
- package/src/mocks/GRCh38/static.ts +36 -148
- package/src/mocks/GRCh38/str.ped +1 -0
- package/src/mocks/GRCh38/vcf/family.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/family.vcf +312 -0
- package/src/mocks/GRCh38/vcf/fixPaths.sql +7 -0
- package/src/mocks/GRCh38/vcf/no_vep.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/{no_vep.vcf.blob → no_vep.vcf} +1 -1
- package/src/mocks/GRCh38/vcf/samples_0.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/samples_1.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/samples_100.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/{samples_100.vcf.blob → samples_100.vcf} +6 -6
- package/src/mocks/GRCh38/vcf/str.db.blob +0 -0
- package/src/mocks/GRCh38/vcf/{str.vcf.blob → str.vcf} +17 -17
- package/src/mocks/MockApiClient.ts +60 -226
- package/src/mocks/config_cram.json +4 -0
- package/src/mocks/config_default_values.json +722 -0
- package/src/mocks/config_vcf.json +15 -1
- package/src/mocks/sql-wasm.wasm.blob +0 -0
- package/src/types/config.d.ts +9 -5
- package/src/types/configCells.d.ts +1 -0
- package/src/types/configFilter.d.ts +1 -0
- package/src/types/configFilterComposed.d.ts +3 -0
- package/src/utils/api.ts +21 -49
- package/src/utils/config/configCellsComposed.ts +1 -1
- package/src/utils/config/configCellsField.ts +2 -0
- package/src/utils/config/configFiltersComposed.ts +7 -0
- package/src/utils/config/configFiltersField.ts +3 -2
- package/src/utils/config/configFiltersFixed.ts +7 -0
- package/src/utils/config/configValidator.precompiled.ts +83402 -0
- package/src/utils/config/configValidator.ts +3 -368
- package/src/utils/csq.ts +5 -10
- package/src/utils/decisionTree.ts +8 -9
- package/src/utils/query/query.ts +3 -2
- package/src/utils/query/queryFilter.ts +2 -3
- package/src/utils/query/queryFilterComposed.ts +12 -12
- package/src/utils/query/queryFilterField.ts +14 -7
- package/src/utils/query/queryFilterFixed.ts +5 -5
- package/src/utils/query/querySample.ts +15 -4
- package/src/utils/query/selector.ts +5 -20
- package/src/utils/query/sort.ts +4 -4
- package/src/utils/vcf.ts +20 -11
- package/src/views/Help.tsx +2 -2
- package/src/views/SampleVariant.tsx +4 -1
- package/src/views/Samples.tsx +10 -3
- package/src/views/data/data.tsx +2 -2
- package/tests/utils/config/configFiltersComposed.test.ts +2 -0
- package/tests/utils/config/configFiltersField.test.ts +4 -2
- package/tests/utils/config/configFiltersFixed.test.ts +23 -6
- package/tests/utils/query/query.test.ts +34 -6
- package/tests/utils/query/queryFilter.test.ts +4 -31
- package/tests/utils/query/queryFilterComposed.test.ts +13 -13
- package/tests/utils/query/queryFilterField.test.ts +5 -5
- package/tests/utils/query/queryFilterFixed.test.ts +5 -5
- package/tests/utils/query/querySample.test.ts +50 -10
- package/tests/utils/query/sort.test.ts +1 -1
- package/tests/utils/vcf.test.ts +1 -0
- package/vite.config.mts +2 -1
- package/src/mocks/GRCh37/alignment.cram.blob +0 -0
- package/src/mocks/GRCh37/alignment.cram.crai.blob +0 -0
- package/src/mocks/GRCh37/decisionTree.json +0 -355
- package/src/mocks/GRCh37/fasta/1-10042288-10042788.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/1-152520538-152521038.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/1-16375333-16375833.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/1-16376162-16376662.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/1-17348965-17349469.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/1-17348969-17349469.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/1-17354844-17355344.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/10-126091249-126091749.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/11-134013975-134014475.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/13-77569878-77570378.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/14-105167610-105168110.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/14-89307588-89308088.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/14-89309945-89310445.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/14-89336157-89336657.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/17-29555814-29556314.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/17-29585172-29585672.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/17-29663629-29664129.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/17-29675976-29676476.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/17-29683733-29684233.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/19-11215896-11216396.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/19-11223801-11224301.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/19-17449149-17449649.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/19-17451747-17452247.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/2-47635417-47635917.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/20-62326742-62327242.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/22-50627343-50627843.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/22-50721296-50721796.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/4-106320044-106320544.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/7-42017061-42017561.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/7-42064707-42065207.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/8-145140250-145140750.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/8-61764893-61765393.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/9-107546383-107546883.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/9-107584614-107585114.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/MT-15076-15576.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/X-48932771-48933271.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/fasta/Y-2655391-2655891.fasta.gz.blob +0 -0
- package/src/mocks/GRCh37/field_metadata.json +0 -794
- package/src/mocks/GRCh37/genes.gff.gz.blob +0 -0
- package/src/mocks/GRCh37/sampleTree.json +0 -143
- package/src/mocks/GRCh37/static.ts +0 -189
- package/src/mocks/GRCh37/vcf/family.vcf.blob +0 -134
- package/src/mocks/GRCh38/vcf/family.vcf.blob +0 -272
- package/src/mocks/static.ts +0 -1636
- /package/src/mocks/GRCh38/vcf/{samples_0.vcf.blob → samples_0.vcf} +0 -0
- /package/src/mocks/GRCh38/vcf/{samples_1.vcf.blob → samples_1.vcf} +0 -0
|
@@ -465,6 +465,15 @@
|
|
|
465
465
|
"type": "composed",
|
|
466
466
|
"name": "locus"
|
|
467
467
|
},
|
|
468
|
+
{
|
|
469
|
+
"type": "info",
|
|
470
|
+
"name": "CSQ/PICK",
|
|
471
|
+
"defaultValue": "true"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"type": "info",
|
|
475
|
+
"name": "n_object0/n_string1"
|
|
476
|
+
},
|
|
468
477
|
{
|
|
469
478
|
"type": "info",
|
|
470
479
|
"name": "CSQ/SYMBOL"
|
|
@@ -493,7 +502,8 @@
|
|
|
493
502
|
},
|
|
494
503
|
{
|
|
495
504
|
"type": "info",
|
|
496
|
-
"name": "CSQ/VKGL_CL"
|
|
505
|
+
"name": "CSQ/VKGL_CL",
|
|
506
|
+
"defaultValue": "LP,VUS"
|
|
497
507
|
},
|
|
498
508
|
{
|
|
499
509
|
"type": "info",
|
|
@@ -532,6 +542,10 @@
|
|
|
532
542
|
"name": "CSQ/HPO",
|
|
533
543
|
"label": "Gene-phenotype association (HPO)"
|
|
534
544
|
},
|
|
545
|
+
{
|
|
546
|
+
"type": "info",
|
|
547
|
+
"name": "CSQ/PICK"
|
|
548
|
+
},
|
|
535
549
|
{
|
|
536
550
|
"type": "info",
|
|
537
551
|
"name": "CSQ/GADO_PD",
|
|
Binary file
|
package/src/types/config.d.ts
CHANGED
|
@@ -73,27 +73,31 @@ export type ConfigJsonFieldItem =
|
|
|
73
73
|
export type ConfigJsonFieldItemGroup = { type: "group"; fields: ConfigJsonFieldItem[] };
|
|
74
74
|
export type ConfigJsonField = ConfigJsonFieldItem | ConfigJsonFieldItemGroup;
|
|
75
75
|
|
|
76
|
-
export interface
|
|
76
|
+
export interface DescribableFilter extends Describable {
|
|
77
|
+
defaultValue?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ConfigJsonFilterFixed extends DescribableFilter {
|
|
77
81
|
type: "fixed";
|
|
78
82
|
name: "chrom" | "pos" | "id" | "ref" | "alt" | "qual" | "filter";
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
export interface ConfigJsonFilterInfo extends
|
|
85
|
+
export interface ConfigJsonFilterInfo extends DescribableFilter {
|
|
82
86
|
type: "info";
|
|
83
87
|
name: string;
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
export interface ConfigJsonFilterFormat extends
|
|
90
|
+
export interface ConfigJsonFilterFormat extends DescribableFilter {
|
|
87
91
|
type: "format";
|
|
88
92
|
name: string;
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
export interface ConfigJsonFilterGenotype extends
|
|
95
|
+
export interface ConfigJsonFilterGenotype extends DescribableFilter {
|
|
92
96
|
type: "genotype";
|
|
93
97
|
name: string;
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
export interface ConfigJsonFilterComposed extends
|
|
100
|
+
export interface ConfigJsonFilterComposed extends DescribableFilter {
|
|
97
101
|
type: "composed";
|
|
98
102
|
name: "allelicImbalance" | "deNovo" | "hpo" | "inheritanceMatch" | "locus" | "vipC" | "vipCS";
|
|
99
103
|
}
|
|
@@ -20,6 +20,7 @@ export type CellType =
|
|
|
20
20
|
interface ConfigCellBase<T extends CellValue> {
|
|
21
21
|
type: CellType;
|
|
22
22
|
label: () => string;
|
|
23
|
+
parentLabel?: () => string;
|
|
23
24
|
description: () => string | null;
|
|
24
25
|
value: (record: Item<VcfRecord>, valueIndex: number) => T;
|
|
25
26
|
valueCount: (record: Item<VcfRecord>) => number;
|
|
@@ -10,6 +10,7 @@ import { FieldMetadataWrapper } from "../utils/vcf.ts";
|
|
|
10
10
|
|
|
11
11
|
export type ChromosomeId = string;
|
|
12
12
|
export type FilterValueHpo = FilterValueCategorical;
|
|
13
|
+
export type FilterValuePick = FilterValueCategorical;
|
|
13
14
|
export type FilterValueLocus = { chromosome: ChromosomeId; start?: number; end?: number };
|
|
14
15
|
export type FilterValueVipC = FilterValueCategorical;
|
|
15
16
|
export type FilterValueVipCS = FilterValueCategorical;
|
|
@@ -23,10 +24,12 @@ export type ConfigFilterComposed =
|
|
|
23
24
|
| ConfigFilterAllelicImbalance
|
|
24
25
|
| ConfigFilterInheritanceMatch
|
|
25
26
|
| ConfigFilterDeNovo
|
|
27
|
+
| ConfigFilterPick
|
|
26
28
|
| ConfigFilterVipC
|
|
27
29
|
| ConfigFilterVipCS;
|
|
28
30
|
|
|
29
31
|
export type ConfigFilterHpo = ConfigFilterField;
|
|
32
|
+
export type ConfigFilterPick = ConfigFilterField;
|
|
30
33
|
|
|
31
34
|
export interface ConfigFilterAllelicImbalance extends ConfigFilterBase {
|
|
32
35
|
sample: SampleContainer;
|
package/src/utils/api.ts
CHANGED
|
@@ -2,26 +2,23 @@ import {
|
|
|
2
2
|
AppMetadata,
|
|
3
3
|
Cram,
|
|
4
4
|
DecisionTree,
|
|
5
|
-
HtsFileMetadata,
|
|
6
5
|
Item,
|
|
7
|
-
Json,
|
|
8
6
|
PagedItems,
|
|
9
7
|
Params,
|
|
10
8
|
PhenotypicFeature,
|
|
11
9
|
Query,
|
|
10
|
+
RecordParams,
|
|
12
11
|
Sample,
|
|
13
|
-
WindowApiClient,
|
|
14
12
|
} from "@molgenis/vip-report-api";
|
|
15
13
|
import { isSampleFather, isSampleMother } from "./sample.ts";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { createFieldMap, FieldMap, isNumerical } from "./vcf.ts";
|
|
19
|
-
import { compareCsq, compareCsqDefault } from "./csq.ts";
|
|
14
|
+
import { InfoOrder, VcfMetadata, VcfRecord } from "@molgenis/vip-report-vcf";
|
|
15
|
+
import { createFieldMap, FieldMap } from "./vcf.ts";
|
|
20
16
|
import { VariantTypeId } from "./variantType.ts";
|
|
21
17
|
import { MockApiClient } from "../mocks/MockApiClient.ts";
|
|
22
18
|
import { ConfigJson } from "../types/config";
|
|
23
19
|
import { RuntimeError } from "./error.ts";
|
|
24
20
|
import { validateConfig } from "./config/configValidator.ts";
|
|
21
|
+
import { WindowApiClientFactory } from "@molgenis/vip-report-api";
|
|
25
22
|
|
|
26
23
|
export type VcfMetadataContainer = VcfMetadata & {
|
|
27
24
|
fieldMap: FieldMap;
|
|
@@ -31,7 +28,6 @@ export type VcfMetadataContainer = VcfMetadata & {
|
|
|
31
28
|
*/
|
|
32
29
|
export type MetadataContainer = {
|
|
33
30
|
app: AppMetadata;
|
|
34
|
-
htsFile: HtsFileMetadata;
|
|
35
31
|
records: VcfMetadataContainer;
|
|
36
32
|
variantTypeIds: Set<VariantTypeId>;
|
|
37
33
|
};
|
|
@@ -50,7 +46,7 @@ export type SampleContainer = {
|
|
|
50
46
|
|
|
51
47
|
// lazy import MockApiClient to ensure that it is excluded from the build artifact
|
|
52
48
|
const api = import.meta.env.PROD
|
|
53
|
-
?
|
|
49
|
+
? await (async () => await WindowApiClientFactory.create())()
|
|
54
50
|
: await (async () => {
|
|
55
51
|
const module = await import("../mocks/MockApiClient.ts");
|
|
56
52
|
return new module.MockApiClient();
|
|
@@ -58,7 +54,7 @@ const api = import.meta.env.PROD
|
|
|
58
54
|
|
|
59
55
|
export async function fetchConfig(): Promise<ConfigJson> {
|
|
60
56
|
console.log("Api.fetchConfig");
|
|
61
|
-
const config
|
|
57
|
+
const config = await api.getConfig();
|
|
62
58
|
if (config === null) throw new RuntimeError("no config provided");
|
|
63
59
|
return validateConfig(config);
|
|
64
60
|
}
|
|
@@ -89,9 +85,8 @@ export async function fetchSamples(params: Params): Promise<PagedItems<SampleCon
|
|
|
89
85
|
*/
|
|
90
86
|
export async function fetchMetadata(): Promise<MetadataContainer> {
|
|
91
87
|
console.log("Api.fetchMetadata");
|
|
92
|
-
const [appMetadata,
|
|
88
|
+
const [appMetadata, recordsMetadata, variantTypeIds] = await Promise.all([
|
|
93
89
|
api.getAppMetadata(),
|
|
94
|
-
api.getHtsFileMetadata(),
|
|
95
90
|
api.getRecordsMeta(),
|
|
96
91
|
fetchVariantTypeIdsQuery(),
|
|
97
92
|
]);
|
|
@@ -99,7 +94,7 @@ export async function fetchMetadata(): Promise<MetadataContainer> {
|
|
|
99
94
|
// precompute field map
|
|
100
95
|
const fieldMap = createFieldMap(recordsMetadata);
|
|
101
96
|
|
|
102
|
-
return { app: appMetadata,
|
|
97
|
+
return { app: appMetadata, records: { ...recordsMetadata, fieldMap }, variantTypeIds };
|
|
103
98
|
}
|
|
104
99
|
|
|
105
100
|
/**
|
|
@@ -118,48 +113,25 @@ export async function fetchSampleById(sampleId: number): Promise<SampleContainer
|
|
|
118
113
|
return composeSample(sample, phenotypicFeatures, pedigreeSamples, variantTypeIds);
|
|
119
114
|
}
|
|
120
115
|
|
|
121
|
-
export async function fetchRecordById(id: number): Promise<Item<VcfRecord>> {
|
|
116
|
+
export async function fetchRecordById(id: number, samples?: Item<Sample>[]): Promise<Item<VcfRecord>> {
|
|
122
117
|
console.log("Api.fetchRecordById", id);
|
|
123
|
-
|
|
118
|
+
const sampleIds = samples?.map((sample) => sample.id) ?? [];
|
|
119
|
+
return api.getRecordById(id, sampleIds);
|
|
124
120
|
}
|
|
125
121
|
|
|
126
|
-
export async function fetchRecords(params:
|
|
122
|
+
export async function fetchRecords(params: RecordParams): Promise<PagedItems<VcfRecord>> {
|
|
127
123
|
console.log("Api.fetchRecords", JSON.stringify(params));
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return records;
|
|
131
|
-
}
|
|
124
|
+
return api.getRecords(params);
|
|
125
|
+
}
|
|
132
126
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
isNumerical(order.field) &&
|
|
137
|
-
order.field.number.type === "NUMBER" &&
|
|
138
|
-
order.field.number.count === 1,
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
const fieldMetas = (recordsMeta.info.CSQ.nested as NestedFieldMetadata).items;
|
|
142
|
-
const consequenceIndex = fieldMetas.findIndex((item) => item.id === "Consequence");
|
|
143
|
-
const pickIndex = fieldMetas.findIndex((item) => item.id === "PICK");
|
|
144
|
-
|
|
145
|
-
for (const record of records.items) {
|
|
146
|
-
const csqArray = record.data.n.CSQ as Value[][] | undefined;
|
|
147
|
-
if (csqArray) {
|
|
148
|
-
csqArray.sort((aValue, bValue) => {
|
|
149
|
-
for (const order of orders) {
|
|
150
|
-
const compareValue = compareCsq(aValue, bValue, order.field, order.direction);
|
|
151
|
-
if (compareValue !== 0) return compareValue;
|
|
152
|
-
}
|
|
153
|
-
return compareCsqDefault(aValue, bValue, pickIndex, consequenceIndex);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return records;
|
|
127
|
+
export async function fetchInfoOrder(): Promise<InfoOrder> {
|
|
128
|
+
console.log("Api.fetchInfoOrder");
|
|
129
|
+
return api.getInfoOrder();
|
|
158
130
|
}
|
|
159
131
|
|
|
160
132
|
export async function fetchSampleProbandIds(): Promise<number[]> {
|
|
161
133
|
console.log("Api.fetchSampleProbandIds");
|
|
162
|
-
const query: Query = { selector: ["proband"], operator: "==", args: true };
|
|
134
|
+
const query: Query = { selector: ["sample", "proband"], operator: "==", args: true };
|
|
163
135
|
const samplePagedItems = await api.getSamples({ query, page: 0, size: Number.MAX_SAFE_INTEGER });
|
|
164
136
|
return samplePagedItems.items.map((sampleItem) => sampleItem.id);
|
|
165
137
|
}
|
|
@@ -232,8 +204,8 @@ async function fetchPedigreeSamples(sample: Item<Sample>): Promise<PagedItems<Sa
|
|
|
232
204
|
query: {
|
|
233
205
|
operator: "and",
|
|
234
206
|
args: [
|
|
235
|
-
{ selector: ["
|
|
236
|
-
{ selector: ["
|
|
207
|
+
{ selector: ["sample", "individualId"], operator: "!=", args: sample.data.person.individualId },
|
|
208
|
+
{ selector: ["sample", "familyId"], operator: "==", args: sample.data.person.familyId },
|
|
237
209
|
],
|
|
238
210
|
},
|
|
239
211
|
size: Number.MAX_SAFE_INTEGER,
|
|
@@ -242,7 +214,7 @@ async function fetchPedigreeSamples(sample: Item<Sample>): Promise<PagedItems<Sa
|
|
|
242
214
|
|
|
243
215
|
async function fetchPhenotypicFeatures(sample: Item<Sample>): Promise<PhenotypicFeature[]> {
|
|
244
216
|
const phenotypes = await api.getPhenotypes({
|
|
245
|
-
query: { selector: ["
|
|
217
|
+
query: { selector: ["sample", "individualId"], operator: "==", args: sample.data.person.individualId },
|
|
246
218
|
size: Number.MAX_SAFE_INTEGER,
|
|
247
219
|
});
|
|
248
220
|
return phenotypes.items.map((item) => item.data).flatMap((phenotype) => phenotype.phenotypicFeaturesList);
|
|
@@ -425,7 +425,7 @@ function createConfigFieldCustomVipCS(
|
|
|
425
425
|
];
|
|
426
426
|
return {
|
|
427
427
|
vipCS: vipCS[valueIndex]!,
|
|
428
|
-
vipPS: vipPS && vipPS[valueIndex]
|
|
428
|
+
vipPS: vipPS && vipPS.length > 0 && vipPS[valueIndex] !== undefined ? vipPS[valueIndex].split("&") : undefined,
|
|
429
429
|
};
|
|
430
430
|
},
|
|
431
431
|
};
|
|
@@ -27,6 +27,8 @@ function createConfigFieldInfo(configStatic: ConfigJsonFieldInfo, field: FieldMe
|
|
|
27
27
|
return {
|
|
28
28
|
type: "info",
|
|
29
29
|
field,
|
|
30
|
+
parentLabel: () =>
|
|
31
|
+
field.parent !== undefined ? getLabel(configStatic, field.parent.label || field.parent.id) : "",
|
|
30
32
|
label: () => getLabel(configStatic, field.label || field.id),
|
|
31
33
|
description: () => getDescription(configStatic, field.description),
|
|
32
34
|
valueCount: (record: Item<VcfRecord>) => getInfoValueCount(record, field),
|
|
@@ -78,6 +78,7 @@ function createConfigFilterHpo(
|
|
|
78
78
|
label: () => getLabel(configStatic, fieldCsqHpo.label || "HPO"),
|
|
79
79
|
description: () => getDescription(configStatic, filterField.description),
|
|
80
80
|
field: filterField,
|
|
81
|
+
defaultValue: configStatic.defaultValue,
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -91,6 +92,7 @@ function createConfigFilterLocus(
|
|
|
91
92
|
label: () => getLabel(configStatic, "Locus"),
|
|
92
93
|
description: () => getDescription(configStatic),
|
|
93
94
|
chromosomes: parseContigIds(metadata.records),
|
|
95
|
+
defaultValue: configStatic.defaultValue,
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
|
|
@@ -110,6 +112,7 @@ function createConfigFilterAllelicImbalance(
|
|
|
110
112
|
description: () => getDescription(configStatic, fieldViab.description),
|
|
111
113
|
genotypeField: fieldGenotype,
|
|
112
114
|
viabField: fieldViab,
|
|
115
|
+
defaultValue: configStatic.defaultValue,
|
|
113
116
|
sample: sample,
|
|
114
117
|
};
|
|
115
118
|
}
|
|
@@ -129,6 +132,7 @@ function createConfigFilterInheritanceMatch(
|
|
|
129
132
|
label: () => getLabel(configStatic, vimField.label || "VIM"),
|
|
130
133
|
description: () => getDescription(configStatic, vimField.description),
|
|
131
134
|
vimField: { ...vimField, required: true },
|
|
135
|
+
defaultValue: configStatic.defaultValue,
|
|
132
136
|
sample: sample,
|
|
133
137
|
};
|
|
134
138
|
}
|
|
@@ -148,6 +152,7 @@ function createConfigFilterDeNovo(
|
|
|
148
152
|
label: () => configStatic.label || vidField.label || "VID",
|
|
149
153
|
description: () => configStatic.description || vidField.description || null,
|
|
150
154
|
vidField: { ...vidField, required: true },
|
|
155
|
+
defaultValue: configStatic.defaultValue,
|
|
151
156
|
sample: sample,
|
|
152
157
|
};
|
|
153
158
|
}
|
|
@@ -176,6 +181,7 @@ function createConfigFilterVipC(
|
|
|
176
181
|
label: () => getLabel(configStatic, vipCField.label || "VIPC"),
|
|
177
182
|
description: () => getDescription(configStatic, vipCField.description),
|
|
178
183
|
field: { ...vipCField, categories: treeCategories },
|
|
184
|
+
defaultValue: configStatic.defaultValue,
|
|
179
185
|
};
|
|
180
186
|
}
|
|
181
187
|
|
|
@@ -203,6 +209,7 @@ function createConfigFilterVipCS(
|
|
|
203
209
|
label: () => getLabel(configStatic, vipCSField.label || "VIPC_S"),
|
|
204
210
|
description: () => getDescription(configStatic, vipCSField.description),
|
|
205
211
|
field: { ...vipCSField, categories: treeCategories, required: true },
|
|
212
|
+
defaultValue: configStatic.defaultValue,
|
|
206
213
|
sample,
|
|
207
214
|
};
|
|
208
215
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigJsonFieldGenotype, ConfigJsonFieldInfo } from "../../types/config";
|
|
1
|
+
import { ConfigJsonFieldGenotype, ConfigJsonFieldInfo, ConfigJsonFilterInfo } from "../../types/config";
|
|
2
2
|
import { ConfigFilterField, ConfigFilterFormat } from "../../types/configFilter";
|
|
3
3
|
import { SampleContainer, VcfMetadataContainer } from "../api.ts";
|
|
4
4
|
import { FieldMetadataWrapper, getInfoFieldsRegex, getSampleFieldsRegex } from "../vcf.ts";
|
|
@@ -29,8 +29,9 @@ export function initConfigFiltersGenotype(
|
|
|
29
29
|
.map((field) => createConfigFilterGenotype(config, field, sample));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function createConfigFilterInfo(config:
|
|
32
|
+
function createConfigFilterInfo(config: ConfigJsonFilterInfo, field: FieldMetadataWrapper): ConfigFilterField {
|
|
33
33
|
return {
|
|
34
|
+
defaultValue: config.defaultValue,
|
|
34
35
|
type: "info",
|
|
35
36
|
id: field.id,
|
|
36
37
|
label: () => getLabel(config, field.label || field.id),
|
|
@@ -48,6 +48,7 @@ function createConfigFilterChrom(config: ConfigJsonFilterFixed): ConfigFilterChr
|
|
|
48
48
|
id: "chrom",
|
|
49
49
|
label: () => getLabel(config, "Chromosome"),
|
|
50
50
|
description: () => getDescription(config),
|
|
51
|
+
defaultValue: config.defaultValue,
|
|
51
52
|
};
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -57,6 +58,7 @@ function createConfigFilterPos(config: ConfigJsonFilterFixed): ConfigFilterPos {
|
|
|
57
58
|
id: "pos",
|
|
58
59
|
label: () => getLabel(config, "Position"),
|
|
59
60
|
description: () => getDescription(config),
|
|
61
|
+
defaultValue: config.defaultValue,
|
|
60
62
|
};
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -66,6 +68,7 @@ function createConfigFilterId(config: ConfigJsonFilterFixed): ConfigFilterId {
|
|
|
66
68
|
id: "id",
|
|
67
69
|
label: () => getLabel(config, "Identifiers"),
|
|
68
70
|
description: () => getDescription(config),
|
|
71
|
+
defaultValue: config.defaultValue,
|
|
69
72
|
};
|
|
70
73
|
}
|
|
71
74
|
|
|
@@ -75,6 +78,7 @@ function createConfigFilterRef(config: ConfigJsonFilterFixed): ConfigFilterRef {
|
|
|
75
78
|
id: "ref",
|
|
76
79
|
label: () => getLabel(config, "Reference"),
|
|
77
80
|
description: () => getDescription(config),
|
|
81
|
+
defaultValue: config.defaultValue,
|
|
78
82
|
};
|
|
79
83
|
}
|
|
80
84
|
|
|
@@ -84,6 +88,7 @@ function createConfigFilterAlt(config: ConfigJsonFilterFixed): ConfigFilterAlt {
|
|
|
84
88
|
id: "alt",
|
|
85
89
|
label: () => getLabel(config, "Alt"),
|
|
86
90
|
description: () => getDescription(config),
|
|
91
|
+
defaultValue: config.defaultValue,
|
|
87
92
|
};
|
|
88
93
|
}
|
|
89
94
|
|
|
@@ -93,6 +98,7 @@ function createConfigFilterQual(config: ConfigJsonFilterFixed): ConfigFilterQual
|
|
|
93
98
|
id: "qual",
|
|
94
99
|
label: () => getLabel(config, "Quality"),
|
|
95
100
|
description: () => getDescription(config),
|
|
101
|
+
defaultValue: config.defaultValue,
|
|
96
102
|
};
|
|
97
103
|
}
|
|
98
104
|
|
|
@@ -102,5 +108,6 @@ function createConfigFilterFilter(config: ConfigJsonFilterFixed): ConfigFilterFi
|
|
|
102
108
|
id: "filter",
|
|
103
109
|
label: () => getLabel(config, "Filter"),
|
|
104
110
|
description: () => getDescription(config),
|
|
111
|
+
defaultValue: config.defaultValue,
|
|
105
112
|
};
|
|
106
113
|
}
|