@molgenis/vip-report-template 3.0.0 → 3.1.2
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 +3 -3
- package/src/__tests__/query.test.ts +33 -1
- package/src/components/Anchor.tsx +10 -7
- package/src/components/ConsequenceTable.tsx +11 -4
- package/src/components/HpoTerm.tsx +13 -0
- package/src/components/InfoCollapsablePane.tsx +29 -22
- package/src/components/SampleTable.tsx +4 -3
- package/src/components/VariantInfoNestedTable.tsx +26 -16
- package/src/components/VariantInfoTable.tsx +9 -4
- package/src/components/VariantSampleTable.tsx +4 -4
- package/src/components/VariantsSampleTable.tsx +3 -2
- package/src/components/VariantsTable.tsx +13 -32
- package/src/components/filter/Filter.tsx +12 -8
- package/src/components/filter/FilterCategorical.tsx +11 -10
- package/src/components/filter/FilterClinVar.tsx +21 -0
- package/src/components/filter/FilterIntegerDp.tsx +2 -9
- package/src/components/filter/FilterIntegerVid.tsx +2 -9
- package/src/components/filter/FilterIntegerVim.tsx +2 -9
- package/src/components/filter/InfoFilter.tsx +3 -9
- package/src/components/record/Format.tsx +13 -4
- package/src/components/record/Info.tsx +18 -32
- package/src/components/record/field/Field.tsx +22 -7
- package/src/components/record/info/ClinVar.tsx +77 -33
- package/src/components/record/info/Consequence.tsx +7 -8
- package/src/components/record/info/Gene.tsx +52 -7
- package/src/components/record/info/GnomAD.tsx +40 -20
- package/src/components/record/info/Hgvs.tsx +11 -9
- package/src/components/record/info/PubMed.tsx +17 -13
- package/src/mocks/GRCh37/vcf/family.vcf.blob +39 -39
- package/src/utils/ApiUtils.ts +10 -9
- package/src/utils/csqUtils.ts +27 -0
- package/src/utils/query.ts +21 -0
- package/src/views/Home.tsx +1 -1
- package/src/views/SampleVariant.tsx +2 -2
- package/src/views/SampleVariantConsequence.tsx +12 -5
- package/src/views/SampleVariants.tsx +16 -7
- package/src/views/Variant.tsx +1 -1
- package/src/views/VariantConsequence.tsx +2 -2
- package/src/views/Variants.tsx +11 -5
- package/src/components/record/info/HpoTerm.tsx +0 -12
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Component, createResource, Show } from "solid-js";
|
|
2
2
|
import { useRouteData } from "solid-app-router";
|
|
3
3
|
import { Loader } from "../components/Loader";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
fetchDecisionTree,
|
|
6
|
+
fetchHtsFileMetadata,
|
|
7
|
+
fetchPedigreeSamples,
|
|
8
|
+
fetchRecordsMeta,
|
|
9
|
+
getRecordLabel,
|
|
10
|
+
} from "../utils/ApiUtils";
|
|
5
11
|
import { VariantTable } from "../components/VariantTable";
|
|
6
12
|
import { VariantInfoTable } from "../components/VariantInfoTable";
|
|
7
13
|
import { VariantSampleTable } from "../components/VariantSampleTable";
|
|
@@ -22,6 +28,7 @@ export const SampleVariantConsequenceView: Component = () => {
|
|
|
22
28
|
const [pedigreeSamples] = createResource(sample, fetchPedigreeSamples);
|
|
23
29
|
const [recordsMeta] = createResource(fetchRecordsMeta);
|
|
24
30
|
const [decisionTree] = createResource(fetchDecisionTree, { initialValue: null });
|
|
31
|
+
const [htsFileMeta] = createResource(fetchHtsFileMetadata);
|
|
25
32
|
|
|
26
33
|
return (
|
|
27
34
|
<Show when={sample() && variant()} fallback={<Loader />}>
|
|
@@ -34,7 +41,7 @@ export const SampleVariantConsequenceView: Component = () => {
|
|
|
34
41
|
{ text: `Consequence #${consequenceId}` },
|
|
35
42
|
]}
|
|
36
43
|
/>
|
|
37
|
-
<Show when={pedigreeSamples() && recordsMeta()} fallback={<Loader />}>
|
|
44
|
+
<Show when={pedigreeSamples() && recordsMeta() && htsFileMeta()} fallback={<Loader />}>
|
|
38
45
|
<SampleVariantConsequence
|
|
39
46
|
sample={sample()!}
|
|
40
47
|
pedigreeSamples={pedigreeSamples()!.items}
|
|
@@ -64,7 +71,7 @@ export const SampleVariantConsequence: Component<{
|
|
|
64
71
|
<ConsequenceTable
|
|
65
72
|
csqMetadata={props.recordsMeta.info.CSQ.nested !== undefined ? props.recordsMeta.info.CSQ.nested.items : []}
|
|
66
73
|
csqValues={getSpecificConsequence(props.variant.data.n.CSQ as ValueArray, props.consequenceId)}
|
|
67
|
-
record={props.variant
|
|
74
|
+
record={props.variant}
|
|
68
75
|
/>
|
|
69
76
|
</div>
|
|
70
77
|
{props.decisionTree !== null && (
|
|
@@ -84,7 +91,7 @@ export const SampleVariantConsequence: Component<{
|
|
|
84
91
|
</div>
|
|
85
92
|
<div class="column is-3">
|
|
86
93
|
<h1 class="title is-5">Info</h1>
|
|
87
|
-
<VariantInfoTable infoFields={props.recordsMeta.info} record={props.variant
|
|
94
|
+
<VariantInfoTable infoFields={props.recordsMeta.info} record={props.variant} />
|
|
88
95
|
</div>
|
|
89
96
|
<div class="column">
|
|
90
97
|
<h1 class="title is-5">Samples</h1>
|
|
@@ -96,7 +103,7 @@ export const SampleVariantConsequence: Component<{
|
|
|
96
103
|
props.sample.data,
|
|
97
104
|
props.pedigreeSamples.map((item) => item.data)
|
|
98
105
|
)}
|
|
99
|
-
record={props.variant
|
|
106
|
+
record={props.variant}
|
|
100
107
|
/>
|
|
101
108
|
</div>
|
|
102
109
|
</div>
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Component, createMemo, createResource, Show } from "solid-js";
|
|
2
2
|
import { useRouteData } from "solid-app-router";
|
|
3
|
-
import { Item, Params, PhenotypicFeature, Sample, SortPath } from "@molgenis/vip-report-api/src/Api";
|
|
3
|
+
import { HtsFileMetadata, Item, Params, PhenotypicFeature, Sample, SortPath } from "@molgenis/vip-report-api/src/Api";
|
|
4
4
|
import { Loader } from "../components/Loader";
|
|
5
5
|
import { SearchBox } from "../components/SearchBox";
|
|
6
6
|
import { Sort, SortEvent } from "../components/Sort";
|
|
7
7
|
import { Pager } from "../components/record/Pager";
|
|
8
8
|
import { RecordDownload } from "../components/record/RecordDownload";
|
|
9
|
-
import {
|
|
9
|
+
import { createSampleQuery, infoSelector, infoSortPath, sampleSelector } from "../utils/query";
|
|
10
10
|
import { VariantsSampleTable } from "../components/VariantsSampleTable";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
fetchHtsFileMetadata,
|
|
13
|
+
fetchPedigreeSamples,
|
|
14
|
+
fetchPhenotypicFeatures,
|
|
15
|
+
fetchRecords,
|
|
16
|
+
fetchRecordsMeta,
|
|
17
|
+
} from "../utils/ApiUtils";
|
|
12
18
|
import { Breadcrumb } from "../components/Breadcrumb";
|
|
13
19
|
import { FieldMetadata } from "@molgenis/vip-report-vcf/src/MetadataParser";
|
|
14
20
|
import { Filters } from "../components/filter/Filters";
|
|
@@ -26,6 +32,7 @@ export const SampleVariantsView: Component = () => {
|
|
|
26
32
|
const [pedigreeSamples] = createResource(sample, fetchPedigreeSamples);
|
|
27
33
|
const [samplePhenotypes] = createResource(sample, fetchPhenotypicFeatures);
|
|
28
34
|
const [recordsMeta] = createResource(fetchRecordsMeta);
|
|
35
|
+
const [htsFileMeta] = createResource(fetchHtsFileMetadata);
|
|
29
36
|
|
|
30
37
|
return (
|
|
31
38
|
<Show when={sample()} fallback={<Loader />}>
|
|
@@ -36,12 +43,13 @@ export const SampleVariantsView: Component = () => {
|
|
|
36
43
|
{ text: "Variants" },
|
|
37
44
|
]}
|
|
38
45
|
/>
|
|
39
|
-
<Show when={pedigreeSamples() && samplePhenotypes() && recordsMeta()} fallback={<Loader />}>
|
|
46
|
+
<Show when={pedigreeSamples() && samplePhenotypes() && recordsMeta() && htsFileMeta()} fallback={<Loader />}>
|
|
40
47
|
<SampleVariants
|
|
41
48
|
sample={sample()!}
|
|
42
49
|
samplePhenotypes={samplePhenotypes()!}
|
|
43
50
|
pedigreeSamples={pedigreeSamples()!.items}
|
|
44
51
|
recordsMeta={recordsMeta()!}
|
|
52
|
+
htsFileMeta={htsFileMeta()!}
|
|
45
53
|
/>
|
|
46
54
|
</Show>
|
|
47
55
|
</Show>
|
|
@@ -53,6 +61,7 @@ export const SampleVariants: Component<{
|
|
|
53
61
|
samplePhenotypes: PhenotypicFeature[];
|
|
54
62
|
pedigreeSamples: Item<Sample>[];
|
|
55
63
|
recordsMeta: Metadata;
|
|
64
|
+
htsFileMeta: HtsFileMetadata;
|
|
56
65
|
}> = (props) => {
|
|
57
66
|
const [state, actions] = useStore();
|
|
58
67
|
|
|
@@ -113,7 +122,6 @@ export const SampleVariants: Component<{
|
|
|
113
122
|
"Consequence",
|
|
114
123
|
"SYMBOL",
|
|
115
124
|
"InheritanceModesGene",
|
|
116
|
-
"IncompletePenetrance",
|
|
117
125
|
"HPO",
|
|
118
126
|
"HGVSc",
|
|
119
127
|
"HGVSp",
|
|
@@ -121,7 +129,7 @@ export const SampleVariants: Component<{
|
|
|
121
129
|
"VIPC",
|
|
122
130
|
"UMCG_CL",
|
|
123
131
|
"VKGL_CL",
|
|
124
|
-
"
|
|
132
|
+
"clinVar_CLNSIG",
|
|
125
133
|
"gnomAD_AF",
|
|
126
134
|
"gnomAD_HN",
|
|
127
135
|
"PUBMED",
|
|
@@ -157,7 +165,7 @@ export const SampleVariants: Component<{
|
|
|
157
165
|
|
|
158
166
|
const params = (): Params => {
|
|
159
167
|
return {
|
|
160
|
-
query:
|
|
168
|
+
query: createSampleQuery(props.sample, searchQuery(), filterQueries(), props.recordsMeta) || undefined,
|
|
161
169
|
sort: sort() || undefined,
|
|
162
170
|
page: page() || undefined,
|
|
163
171
|
size: pageSize() || undefined,
|
|
@@ -238,6 +246,7 @@ export const SampleVariants: Component<{
|
|
|
238
246
|
records={records.items}
|
|
239
247
|
recordsMetadata={props.recordsMeta}
|
|
240
248
|
nestedFields={infoFields()}
|
|
249
|
+
htsFileMeta={props.htsFileMeta}
|
|
241
250
|
/>
|
|
242
251
|
)}
|
|
243
252
|
</Show>
|
package/src/views/Variant.tsx
CHANGED
|
@@ -35,7 +35,7 @@ export const Variant: Component = () => {
|
|
|
35
35
|
>
|
|
36
36
|
<div class="column is-3">
|
|
37
37
|
<h1 class="title is-5">Info</h1>
|
|
38
|
-
<VariantInfoTable infoFields={recordsMetadata().info} record={variant()
|
|
38
|
+
<VariantInfoTable infoFields={recordsMetadata().info} record={variant()} />
|
|
39
39
|
</div>
|
|
40
40
|
</Show>
|
|
41
41
|
</div>
|
|
@@ -40,7 +40,7 @@ export const VariantConsequence: Component = () => {
|
|
|
40
40
|
<div class="columns">
|
|
41
41
|
<div class="column is-6">
|
|
42
42
|
<h1 class="title is-5">Consequence</h1>
|
|
43
|
-
<ConsequenceTable csqMetadata={csqFields()} csqValues={csqValues()} record={variant()
|
|
43
|
+
<ConsequenceTable csqMetadata={csqFields()} csqValues={csqValues()} record={variant()} />
|
|
44
44
|
</div>
|
|
45
45
|
<Show when={!recordsMetadata.loading && !decisionTree.loading && (decisionTree() as DecisionTree)}>
|
|
46
46
|
{(decisionTree) => (
|
|
@@ -61,7 +61,7 @@ export const VariantConsequence: Component = () => {
|
|
|
61
61
|
</div>
|
|
62
62
|
<div class="column">
|
|
63
63
|
<h1 class="title is-5">Info</h1>
|
|
64
|
-
<VariantInfoTable infoFields={recordsMetadata().info} record={variant()
|
|
64
|
+
<VariantInfoTable infoFields={recordsMetadata().info} record={variant()} />
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
</Show>
|
package/src/views/Variants.tsx
CHANGED
|
@@ -6,10 +6,10 @@ import { InfoFilters } from "../components/filter/InfoFilters";
|
|
|
6
6
|
import { Sort, SortEvent } from "../components/Sort";
|
|
7
7
|
import { RecordDownload } from "../components/record/RecordDownload";
|
|
8
8
|
import { Breadcrumb } from "../components/Breadcrumb";
|
|
9
|
-
import { fetchRecords, fetchRecordsMeta } from "../utils/ApiUtils";
|
|
9
|
+
import { fetchHtsFileMetadata, fetchRecords, fetchRecordsMeta } from "../utils/ApiUtils";
|
|
10
10
|
import { flattenFieldMetadata } from "../utils/field";
|
|
11
11
|
import { DIRECTION_ASCENDING, DIRECTION_DESCENDING } from "../utils/sortUtils";
|
|
12
|
-
import { Params, SortPath } from "@molgenis/vip-report-api/src/Api";
|
|
12
|
+
import { HtsFileMetadata, Params, SortPath } from "@molgenis/vip-report-api/src/Api";
|
|
13
13
|
import { FilterChangeEvent, FilterClearEvent } from "../components/filter/Filter";
|
|
14
14
|
import { useStore } from "../store";
|
|
15
15
|
import { createQuery, infoSortPath } from "../utils/query";
|
|
@@ -19,12 +19,13 @@ import { arrayEquals } from "../utils/utils";
|
|
|
19
19
|
|
|
20
20
|
export const VariantsView: Component = () => {
|
|
21
21
|
const [recordsMeta] = createResource(fetchRecordsMeta);
|
|
22
|
+
const [htsFileMeta] = createResource(fetchHtsFileMetadata);
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
25
|
<>
|
|
25
26
|
<Breadcrumb items={[{ text: "Variants" }]} />
|
|
26
|
-
<Show when={recordsMeta()} fallback={<Loader />}>
|
|
27
|
-
<Variants recordsMeta={recordsMeta()!} />
|
|
27
|
+
<Show when={recordsMeta() && htsFileMeta} fallback={<Loader />}>
|
|
28
|
+
<Variants recordsMeta={recordsMeta()!} htsFileMeta={htsFileMeta()!} />
|
|
28
29
|
</Show>
|
|
29
30
|
</>
|
|
30
31
|
);
|
|
@@ -32,6 +33,7 @@ export const VariantsView: Component = () => {
|
|
|
32
33
|
|
|
33
34
|
export const Variants: Component<{
|
|
34
35
|
recordsMeta: Metadata;
|
|
36
|
+
htsFileMeta: HtsFileMetadata;
|
|
35
37
|
}> = (props) => {
|
|
36
38
|
const [state, actions] = useStore();
|
|
37
39
|
|
|
@@ -114,7 +116,11 @@ export const Variants: Component<{
|
|
|
114
116
|
</div>
|
|
115
117
|
</div>
|
|
116
118
|
<div class="columns">
|
|
117
|
-
<VariantsTable
|
|
119
|
+
<VariantsTable
|
|
120
|
+
records={records()!.items}
|
|
121
|
+
recordsMetadata={props.recordsMeta}
|
|
122
|
+
htsFileMeta={props.htsFileMeta}
|
|
123
|
+
/>
|
|
118
124
|
</div>
|
|
119
125
|
</div>
|
|
120
126
|
</div>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Component } from "solid-js";
|
|
2
|
-
import { Anchor } from "../../Anchor";
|
|
3
|
-
import { OntologyClass } from "@molgenis/vip-report-api/src/Api";
|
|
4
|
-
|
|
5
|
-
export const HpoTerm: Component<{
|
|
6
|
-
ontologyClass: OntologyClass;
|
|
7
|
-
}> = (props) => {
|
|
8
|
-
const hpoTerm = () => props.ontologyClass.id;
|
|
9
|
-
const label = () => props.ontologyClass.label;
|
|
10
|
-
|
|
11
|
-
return <>{<Anchor href={`https://hpo.jax.org/app/browse/term/${hpoTerm()}`} value={label()} />}</>;
|
|
12
|
-
};
|