@molgenis/vip-report-template 6.2.0 → 7.0.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/.nvmrc +1 -1
- package/.travis.yml +9 -9
- package/README.md +411 -1
- package/eslint.config.mjs +11 -0
- package/package.json +40 -35
- package/scripts/deploy_npm_registry.sh +5 -0
- package/src/App.tsx +30 -24
- package/src/assets/sass/main.scss +12 -4
- package/src/components/Allele.tsx +95 -0
- package/src/components/Anchor.tsx +1 -1
- package/src/components/Breadcrumb.tsx +6 -4
- package/src/components/DatasetDropdown.tsx +12 -25
- package/src/components/ErrorNotification.tsx +9 -0
- package/src/components/GenomeBrowser.tsx +40 -23
- package/src/components/HpoTerm.tsx +1 -1
- package/src/components/{record/Pager.tsx → Pager.tsx} +21 -14
- package/src/components/RecordsPerPage.tsx +9 -7
- package/src/components/RecordsTable.tsx +130 -0
- package/src/components/SampleTable.tsx +70 -98
- package/src/components/SearchBox.tsx +8 -2
- package/src/components/Sort.tsx +28 -25
- package/src/components/Table.tsx +16 -0
- package/src/components/Tooltip.tsx +20 -0
- package/src/components/VariantBreadcrumb.tsx +54 -0
- package/src/components/VariantConsequenceContainer.tsx +100 -0
- package/src/components/VariantConsequenceTable.tsx +58 -0
- package/src/components/VariantContainer.tsx +71 -0
- package/src/components/VariantFilters.tsx +27 -0
- package/src/components/VariantGenotypeTable.tsx +44 -0
- package/src/components/VariantInfoTable.tsx +24 -33
- package/src/components/VariantResults.tsx +103 -0
- package/src/components/VariantTable.tsx +62 -66
- package/src/components/VariantTypeSelect.tsx +34 -0
- package/src/components/VariantsContainer.tsx +150 -0
- package/src/components/VariantsContainerHeader.tsx +70 -0
- package/src/components/field/Field.tsx +80 -0
- package/src/components/field/FieldAlt.tsx +19 -0
- package/src/components/field/FieldChrom.tsx +6 -0
- package/src/components/{record/Id.tsx → field/FieldFilter.tsx} +2 -1
- package/src/components/field/FieldFormat.tsx +10 -0
- package/src/components/{record/Filter.tsx → field/FieldId.tsx} +1 -1
- package/src/components/field/FieldPos.tsx +6 -0
- package/src/components/field/FieldQual.tsx +6 -0
- package/src/components/field/FieldRef.tsx +8 -0
- package/src/components/field/composed/FieldClinVar.tsx +72 -0
- package/src/components/field/composed/FieldComposed.tsx +68 -0
- package/src/components/field/composed/FieldGene.tsx +39 -0
- package/src/components/field/composed/FieldGenotype.tsx +35 -0
- package/src/components/{record/format/GenotypeField.tsx → field/composed/FieldGenotypeSnvSv.tsx} +20 -16
- package/src/components/field/composed/FieldGenotypeStr.tsx +31 -0
- package/src/components/field/composed/FieldGnomAd.tsx +58 -0
- package/src/components/field/composed/FieldHpo.tsx +50 -0
- package/src/components/field/composed/FieldInheritanceModes.tsx +32 -0
- package/src/components/field/composed/FieldLocus.tsx +18 -0
- package/src/components/field/composed/FieldVipC.tsx +25 -0
- package/src/components/field/composed/FieldVipCS.tsx +15 -0
- package/src/components/field/composed/FieldVkgl.tsx +37 -0
- package/src/components/field/genotype/FieldGenotype.tsx +19 -0
- package/src/components/field/genotype/FieldGenotypeType.tsx +9 -0
- package/src/components/field/info/FieldConsequence.tsx +15 -0
- package/src/components/{record/info/Hgvs.tsx → field/info/FieldHgvs.tsx} +4 -6
- package/src/components/field/info/FieldInfo.tsx +27 -0
- package/src/components/{record/info/PubMed.tsx → field/info/FieldPubMed.tsx} +4 -7
- package/src/components/field/typed/FieldCategorical.tsx +17 -0
- package/src/components/{record/field/FieldValueCharacter.tsx → field/typed/FieldCharacter.tsx} +3 -2
- package/src/components/{record/field/FieldValueFlag.tsx → field/typed/FieldFlag.tsx} +3 -2
- package/src/components/{record/field/FieldValueFloat.tsx → field/typed/FieldFloat.tsx} +3 -2
- package/src/components/{record/field/FieldValueInteger.tsx → field/typed/FieldInteger.tsx} +3 -2
- package/src/components/{record/field/FieldValueString.tsx → field/typed/FieldString.tsx} +3 -2
- package/src/components/field/typed/FieldTyped.tsx +20 -0
- package/src/components/field/typed/FieldTypedItem.tsx +49 -0
- package/src/components/field/typed/FieldTypedMultiple.tsx +21 -0
- package/src/components/filter/Filter.tsx +56 -48
- package/src/components/filter/FilterWrapper.scss +23 -0
- package/src/components/filter/FilterWrapper.tsx +63 -0
- package/src/components/filter/composed/FilterAllelicImbalance.tsx +26 -0
- package/src/components/filter/composed/FilterComposed.tsx +92 -0
- package/src/components/filter/composed/FilterDeNovo.tsx +35 -0
- package/src/components/filter/composed/FilterHpo.tsx +16 -0
- package/src/components/filter/composed/FilterInheritance.tsx +42 -0
- package/src/components/filter/composed/FilterLocus.tsx +75 -0
- package/src/components/filter/composed/FilterVipC.tsx +16 -0
- package/src/components/filter/composed/FilterVipCS.tsx +16 -0
- package/src/components/filter/fixed/FilterAlt.tsx +20 -0
- package/src/components/filter/fixed/FilterChrom.tsx +22 -0
- package/src/components/filter/fixed/FilterFilter.tsx +20 -0
- package/src/components/filter/fixed/FilterFixed.tsx +96 -0
- package/src/components/filter/fixed/FilterId.tsx +20 -0
- package/src/components/filter/fixed/FilterPos.tsx +22 -0
- package/src/components/filter/fixed/FilterQual.tsx +21 -0
- package/src/components/filter/fixed/FilterRef.tsx +22 -0
- package/src/components/filter/typed/FilterCategorical.tsx +119 -0
- package/src/components/filter/typed/FilterFlag.tsx +23 -0
- package/src/components/filter/typed/FilterInterval.tsx +72 -0
- package/src/components/filter/typed/FilterString.tsx +43 -0
- package/src/components/filter/typed/FilterTyped.tsx +56 -0
- package/src/components/form/ButtonApply.tsx +11 -0
- package/src/components/form/ButtonDownload.tsx +11 -0
- package/src/components/form/ButtonReset.tsx +9 -0
- package/src/components/{Checkbox.tsx → form/Checkbox.tsx} +4 -9
- package/src/components/form/Input.tsx +19 -0
- package/src/components/form/Select.scss +7 -0
- package/src/components/form/Select.tsx +34 -0
- package/src/components/tree/DecisionTreeBoolMultiQuery.tsx +1 -1
- package/src/components/tree/DecisionTreeBoolQuery.tsx +1 -1
- package/src/components/tree/DecisionTreeNode.tsx +41 -39
- package/src/components/tree/DecisionTreeNodeBool.tsx +1 -1
- package/src/components/tree/DecisionTreeNodeBoolMulti.tsx +1 -1
- package/src/components/tree/DecisionTreeNodeCategorical.tsx +1 -1
- package/src/components/tree/DecisionTreeNodeExists.tsx +1 -1
- package/src/components/tree/DecisionTreeNodeLeaf.tsx +1 -1
- package/src/components/tree/DecisionTreeOutcomeNode.tsx +1 -1
- package/src/components/tree/DecisionTreePath.tsx +1 -1
- package/src/igv.d.ts +2 -1
- package/src/index.tsx +48 -19
- package/src/mocks/GRCh37/decisionTree.json +23 -22
- package/src/mocks/GRCh37/field_metadata.json +435 -95
- package/src/mocks/GRCh37/sampleTree.json +21 -1
- package/src/mocks/GRCh37/static.ts +62 -134
- package/src/mocks/GRCh37/vcf/family.vcf.blob +9 -3
- package/src/mocks/GRCh38/decisionTree.json +52 -33
- package/src/mocks/GRCh38/decisionTreeStr.json +572 -0
- package/src/mocks/GRCh38/fasta/chr1_149380406-149403321.fasta.gz.blob +0 -0
- package/src/mocks/GRCh38/field_metadata.json +435 -95
- package/src/mocks/GRCh38/sampleTree.json +175 -0
- package/src/mocks/GRCh38/static.ts +101 -42
- package/src/mocks/GRCh38/str.cram.blob +0 -0
- package/src/mocks/GRCh38/str.cram.crai.blob +0 -0
- package/src/mocks/GRCh38/vcf/family.vcf.blob +25 -24
- package/src/mocks/GRCh38/vcf/no_vep.vcf.blob +29 -28
- package/src/mocks/GRCh38/vcf/samples_0.vcf.blob +28 -27
- package/src/mocks/GRCh38/vcf/samples_1.vcf.blob +29 -28
- package/src/mocks/GRCh38/vcf/samples_100.vcf.blob +28 -27
- package/src/mocks/GRCh38/vcf/str.vcf.blob +321 -0
- package/src/mocks/MockApiClient.ts +339 -332
- package/src/mocks/config_cram.json +701 -0
- package/src/mocks/config_vcf.json +699 -0
- package/src/store/app.ts +30 -0
- package/src/store/index.tsx +3 -168
- package/src/store/variants.ts +182 -0
- package/src/types/config.d.ts +190 -0
- package/src/types/configCellComposed.d.ts +86 -0
- package/src/types/configCells.d.ts +129 -0
- package/src/types/configFilter.d.ts +80 -0
- package/src/types/configFilterComposed.d.ts +60 -0
- package/src/types/configSort.d.ts +13 -0
- package/src/types/filter.d.ts +17 -0
- package/src/types/store.d.ts +34 -0
- package/src/utils/api.ts +281 -0
- package/src/utils/config/config.ts +182 -0
- package/src/utils/config/configCells.ts +74 -0
- package/src/utils/config/configCellsComposed.ts +508 -0
- package/src/utils/config/configCellsField.ts +61 -0
- package/src/utils/config/configCellsFixed.ts +126 -0
- package/src/utils/config/configFilters.ts +46 -0
- package/src/utils/config/configFiltersComposed.ts +208 -0
- package/src/utils/config/configFiltersField.ts +49 -0
- package/src/utils/config/configFiltersFixed.ts +106 -0
- package/src/utils/config/configSorts.ts +44 -0
- package/src/utils/config/configValidator.ts +380 -0
- package/src/utils/config/configVip.ts +25 -0
- package/src/utils/csq.ts +115 -0
- package/src/utils/decisionTree.ts +45 -0
- package/src/utils/download.ts +30 -0
- package/src/utils/error.ts +69 -0
- package/src/utils/query/query.ts +55 -0
- package/src/utils/query/queryFilter.ts +132 -0
- package/src/utils/query/queryFilterComposed.ts +247 -0
- package/src/utils/query/queryFilterField.ts +75 -0
- package/src/utils/query/queryFilterFixed.ts +44 -0
- package/src/utils/query/querySample.ts +18 -0
- package/src/utils/query/queryVariantType.ts +76 -0
- package/src/utils/query/selector.ts +41 -0
- package/src/utils/{sortUtils.ts → query/sort.ts} +32 -11
- package/src/utils/sample.ts +19 -35
- package/src/utils/utils.ts +66 -2
- package/src/utils/variantType.ts +43 -0
- package/src/utils/vcf.ts +352 -0
- package/src/views/Help.tsx +109 -114
- package/src/views/Home.tsx +3 -2
- package/src/views/Sample.tsx +12 -7
- package/src/views/SampleVariant.tsx +23 -112
- package/src/views/SampleVariantConsequence.tsx +54 -144
- package/src/views/SampleVariants.tsx +33 -445
- package/src/views/SampleVariantsRedirect.tsx +20 -0
- package/src/views/Samples.tsx +7 -10
- package/src/views/Variant.tsx +31 -61
- package/src/views/VariantConsequence.tsx +42 -72
- package/src/views/Variants.tsx +29 -138
- package/src/views/VariantsRedirect.tsx +25 -0
- package/src/views/data/data.tsx +32 -6
- package/tests/store/variants.test.ts +122 -0
- package/tests/utils/config/config.test.ts +167 -0
- package/tests/utils/config/configCells.test.ts +86 -0
- package/tests/utils/config/configCellsComposed.test.ts +1163 -0
- package/tests/utils/config/configCellsField.test.ts +164 -0
- package/tests/utils/config/configCellsFixed.test.ts +99 -0
- package/tests/utils/config/configFilters.test.ts +80 -0
- package/tests/utils/config/configFiltersComposed.test.ts +504 -0
- package/tests/utils/config/configFiltersField.test.ts +140 -0
- package/tests/utils/config/configFiltersFixed.test.ts +81 -0
- package/tests/utils/config/configSorts.test.ts +55 -0
- package/tests/utils/config/configValidator.test.ts +56 -0
- package/tests/utils/config/configVip.test.ts +53 -0
- package/tests/utils/decisionTree.test.ts +71 -0
- package/tests/utils/download.test.ts +20 -0
- package/tests/utils/query/query.test.ts +84 -0
- package/tests/utils/query/queryFilter.test.ts +243 -0
- package/tests/utils/query/queryFilterComposed.test.ts +301 -0
- package/tests/utils/query/queryFilterField.test.ts +75 -0
- package/tests/utils/query/queryFilterFixed.test.ts +86 -0
- package/tests/utils/query/querySample.test.ts +45 -0
- package/tests/utils/query/queryVariantType.test.ts +56 -0
- package/{src/__tests__/sortUtils.test.ts → tests/utils/query/sort.test.ts} +3 -4
- package/tests/utils/sample.test.ts +259 -0
- package/tests/utils/utils.test.ts +120 -0
- package/tests/utils/variantType.test.ts +48 -0
- package/tests/utils/vcf.test.ts +649 -0
- package/tsconfig.json +6 -2
- package/vite.config.mts +20 -3
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -23
- package/src/Api.ts +0 -12
- package/src/__tests__/decisionTreeUtils.test.ts +0 -75
- package/src/__tests__/field.test.ts +0 -107
- package/src/__tests__/query.test.ts +0 -188
- package/src/__tests__/sample.test.ts +0 -184
- package/src/__tests__/utils.test.ts +0 -24
- package/src/__tests__/viewUtils.test.ts +0 -125
- package/src/components/ConsequenceTable.tsx +0 -45
- package/src/components/Error.tsx +0 -9
- package/src/components/FieldHeader.tsx +0 -26
- package/src/components/InfoCollapsablePane.tsx +0 -90
- package/src/components/VariantInfoNestedTable.tsx +0 -127
- package/src/components/VariantSampleTable.tsx +0 -58
- package/src/components/VariantsSampleTable.tsx +0 -184
- package/src/components/VariantsTable.tsx +0 -125
- package/src/components/filter/FilterAllelicBalance.tsx +0 -81
- package/src/components/filter/FilterCategorical.tsx +0 -81
- package/src/components/filter/FilterClinVar.tsx +0 -21
- package/src/components/filter/FilterGene.tsx +0 -34
- package/src/components/filter/FilterHpo.tsx +0 -161
- package/src/components/filter/FilterInheritance.tsx +0 -162
- package/src/components/filter/FilterIntegerGq.tsx +0 -47
- package/src/components/filter/FilterVI.tsx +0 -68
- package/src/components/filter/FilterVariantType.tsx +0 -146
- package/src/components/filter/Filters.tsx +0 -29
- package/src/components/filter/InfoFilter.tsx +0 -39
- package/src/components/filter/InfoFilters.tsx +0 -35
- package/src/components/filter/SampleFilters.tsx +0 -93
- package/src/components/filter/SamplesFilters.tsx +0 -33
- package/src/components/record/Allele.tsx +0 -38
- package/src/components/record/AlleleBreakend.tsx +0 -5
- package/src/components/record/AlleleMissing.tsx +0 -5
- package/src/components/record/AlleleNucs.tsx +0 -49
- package/src/components/record/AlleleSymbolic.tsx +0 -5
- package/src/components/record/Alt.tsx +0 -17
- package/src/components/record/Chrom.tsx +0 -5
- package/src/components/record/Format.tsx +0 -40
- package/src/components/record/Info.tsx +0 -55
- package/src/components/record/Pos.tsx +0 -5
- package/src/components/record/Qual.tsx +0 -5
- package/src/components/record/RecordDownload.tsx +0 -66
- package/src/components/record/Ref.tsx +0 -6
- package/src/components/record/field/Field.tsx +0 -36
- package/src/components/record/field/FieldMultipleValue.tsx +0 -22
- package/src/components/record/field/FieldSingleValue.tsx +0 -35
- package/src/components/record/info/ClinVar.tsx +0 -81
- package/src/components/record/info/Consequence.tsx +0 -18
- package/src/components/record/info/Gene.tsx +0 -56
- package/src/components/record/info/GnomAD.tsx +0 -54
- package/src/components/record/info/Hpo.tsx +0 -52
- package/src/components/record/info/InheritanceModes.tsx +0 -22
- package/src/components/record/info/VipC.tsx +0 -23
- package/src/components/record/info/Vkgl.tsx +0 -42
- package/src/mocks/GRCh37/vcf/no_vep.vcf.blob +0 -61
- package/src/mocks/GRCh37/vcf/samples_0.vcf.blob +0 -93
- package/src/mocks/GRCh37/vcf/samples_1.vcf.blob +0 -93
- package/src/mocks/GRCh37/vcf/samples_100.vcf.blob +0 -93
- package/src/utils/ApiUtils.ts +0 -263
- package/src/utils/csqUtils.ts +0 -27
- package/src/utils/decisionTreeUtils.ts +0 -31
- package/src/utils/field.ts +0 -49
- package/src/utils/query.ts +0 -154
- package/src/utils/viewUtils.ts +0 -32
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { VcfRecord } from "@molgenis/vip-report-vcf";
|
|
2
|
+
import { Item } from "@molgenis/vip-report-api";
|
|
3
|
+
import { Component, For, Match, Show, Switch } from "solid-js";
|
|
4
|
+
import { CellValue, ConfigCellGroup, ConfigCellItem } from "../types/configCells";
|
|
5
|
+
import { ConfigCells } from "../types/config";
|
|
6
|
+
import { Abbr } from "./Abbr";
|
|
7
|
+
import { Field } from "./field/Field";
|
|
8
|
+
import { Table } from "./Table.tsx";
|
|
9
|
+
|
|
10
|
+
export const RecordsTable: Component<{
|
|
11
|
+
fieldConfigs: ConfigCells;
|
|
12
|
+
records: Item<VcfRecord>[];
|
|
13
|
+
verticalHeaders?: boolean;
|
|
14
|
+
}> = (props) => {
|
|
15
|
+
return (
|
|
16
|
+
<Table>
|
|
17
|
+
<RecordsTableHeader fieldConfigs={props.fieldConfigs} verticalHeaders={props.verticalHeaders} />
|
|
18
|
+
<RecordsTableBody fieldConfigs={props.fieldConfigs} records={props.records} />
|
|
19
|
+
</Table>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const RecordsTableHeader: Component<{
|
|
24
|
+
fieldConfigs: ConfigCells;
|
|
25
|
+
verticalHeaders?: boolean;
|
|
26
|
+
}> = (props) => {
|
|
27
|
+
return (
|
|
28
|
+
<thead>
|
|
29
|
+
<tr style={props.verticalHeaders ? { "writing-mode": "vertical-rl" } : undefined}>
|
|
30
|
+
<RecordsTableHeaderCells fieldConfigs={props.fieldConfigs} />
|
|
31
|
+
</tr>
|
|
32
|
+
</thead>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const RecordsTableHeaderCells: Component<{ fieldConfigs: ConfigCells }> = (props) => {
|
|
37
|
+
return (
|
|
38
|
+
<For each={props.fieldConfigs}>
|
|
39
|
+
{(fieldConfig) => (
|
|
40
|
+
<Switch fallback={<RecordsTableHeaderCell fieldConfig={fieldConfig as ConfigCellItem} />}>
|
|
41
|
+
<Match when={fieldConfig.type === "group"}>
|
|
42
|
+
<For each={(fieldConfig as ConfigCellGroup).fieldConfigs}>
|
|
43
|
+
{(childConfigField) => <RecordsTableHeaderCell fieldConfig={childConfigField} />}
|
|
44
|
+
</For>
|
|
45
|
+
</Match>
|
|
46
|
+
</Switch>
|
|
47
|
+
)}
|
|
48
|
+
</For>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const RecordsTableHeaderCell: Component<{
|
|
53
|
+
fieldConfig: ConfigCellItem;
|
|
54
|
+
}> = (props) => {
|
|
55
|
+
const label = () => props.fieldConfig.label();
|
|
56
|
+
const description = () => props.fieldConfig.description();
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<th>
|
|
60
|
+
<Show when={description()} fallback={label()}>
|
|
61
|
+
{(description) => <Abbr title={description()} value={label()} />}
|
|
62
|
+
</Show>
|
|
63
|
+
</th>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const RecordsTableBody: Component<{
|
|
68
|
+
fieldConfigs: ConfigCells;
|
|
69
|
+
records: Item<VcfRecord>[];
|
|
70
|
+
}> = (props) => {
|
|
71
|
+
return (
|
|
72
|
+
<tbody>
|
|
73
|
+
<For each={props.records}>
|
|
74
|
+
{(record) => (
|
|
75
|
+
<tr>
|
|
76
|
+
<RecordsTableCells fieldConfigs={props.fieldConfigs} record={record} />
|
|
77
|
+
</tr>
|
|
78
|
+
)}
|
|
79
|
+
</For>
|
|
80
|
+
</tbody>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const RecordsTableCells: Component<{ fieldConfigs: ConfigCells; record: Item<VcfRecord> }> = (props) => {
|
|
85
|
+
return (
|
|
86
|
+
<For each={props.fieldConfigs}>
|
|
87
|
+
{(fieldConfig) => (
|
|
88
|
+
<Switch fallback={<RecordsTableCell fieldConfig={fieldConfig as ConfigCellItem} record={props.record} />}>
|
|
89
|
+
<Match when={fieldConfig.type === "group"}>
|
|
90
|
+
<For each={(fieldConfig as ConfigCellGroup).fieldConfigs}>
|
|
91
|
+
{(childConfigField) => <RecordsTableCell fieldConfig={childConfigField} record={props.record} />}
|
|
92
|
+
</For>
|
|
93
|
+
</Match>
|
|
94
|
+
</Switch>
|
|
95
|
+
)}
|
|
96
|
+
</For>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const RecordsTableCell: Component<{
|
|
101
|
+
fieldConfig: ConfigCellItem;
|
|
102
|
+
record: Item<VcfRecord>;
|
|
103
|
+
}> = (props) => {
|
|
104
|
+
const lineIndices = () => [...Array(props.fieldConfig.valueCount(props.record))].map((_, i) => i);
|
|
105
|
+
return (
|
|
106
|
+
<td>
|
|
107
|
+
<For each={lineIndices()}>
|
|
108
|
+
{(valueIndex) => (
|
|
109
|
+
<RecordsTableCellLine fieldConfig={props.fieldConfig} record={props.record} valueIndex={valueIndex} />
|
|
110
|
+
)}
|
|
111
|
+
</For>
|
|
112
|
+
</td>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const RecordsTableCellLine: Component<{
|
|
117
|
+
fieldConfig: ConfigCellItem;
|
|
118
|
+
record: Item<VcfRecord>;
|
|
119
|
+
valueIndex: number;
|
|
120
|
+
}> = (props) => {
|
|
121
|
+
const value = (): CellValue => props.fieldConfig.value(props.record, props.valueIndex);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div>
|
|
125
|
+
<Field config={props.fieldConfig} value={value()} />
|
|
126
|
+
{/* print Unicode zero width space character to ensure a line with non-zero height */}
|
|
127
|
+
<span>{"\u200b"}</span>
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
@@ -1,110 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component,
|
|
3
|
-
import { Item,
|
|
1
|
+
import { A, useNavigate } from "@solidjs/router";
|
|
2
|
+
import { Component, For, Show } from "solid-js";
|
|
3
|
+
import { Item, PhenotypicFeature } from "@molgenis/vip-report-api";
|
|
4
4
|
import { HpoTerm } from "./HpoTerm";
|
|
5
5
|
import { Anchor } from "./Anchor";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getSampleMother,
|
|
11
|
-
getSampleSexLabel,
|
|
12
|
-
} from "../utils/sample";
|
|
13
|
-
|
|
14
|
-
function mapPhenotypes(phenotypes: Item<Phenotype>[]) {
|
|
15
|
-
const phenoMap: { [key: string]: PhenotypicFeature[] } = {};
|
|
16
|
-
phenotypes.forEach((item: Item<Phenotype>) => {
|
|
17
|
-
phenoMap[item.data.subject.id] = item.data.phenotypicFeaturesList;
|
|
18
|
-
});
|
|
19
|
-
return phenoMap;
|
|
20
|
-
}
|
|
6
|
+
import { getSampleAffectedStatusLabel, getSampleLabel, getSampleSexLabel } from "../utils/sample";
|
|
7
|
+
import { href } from "../utils/utils.ts";
|
|
8
|
+
import { SampleContainer } from "../utils/api.ts";
|
|
9
|
+
import { Table } from "./Table.tsx";
|
|
21
10
|
|
|
22
11
|
export const SampleTable: Component<{
|
|
23
|
-
samples: Item<
|
|
24
|
-
phenotypes: Item<Phenotype>[];
|
|
12
|
+
samples: Item<SampleContainer>[];
|
|
25
13
|
}> = (props) => {
|
|
26
14
|
const navigate = useNavigate();
|
|
27
|
-
const samples = createMemo(() => props.samples.map((item) => item.data));
|
|
28
|
-
const phenoMap = createMemo(() => mapPhenotypes(props.phenotypes));
|
|
29
|
-
|
|
30
|
-
const samplePhenotypes = (sample: Sample): PhenotypicFeature[] => {
|
|
31
|
-
return phenoMap()[sample.person.individualId] ?? [];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const sampleFatherLabel = (sample: Sample): string => {
|
|
35
|
-
const sampleFather = getSampleFather(sample, samples());
|
|
36
|
-
return sampleFather ? getSampleLabel(sampleFather) : "";
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const sampleMotherLabel = (sample: Sample): string => {
|
|
40
|
-
const sampleMother = getSampleMother(sample, samples());
|
|
41
|
-
return sampleMother ? getSampleLabel(sampleMother) : "";
|
|
42
|
-
};
|
|
43
15
|
|
|
44
16
|
return (
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
17
|
+
<Table>
|
|
18
|
+
<thead>
|
|
19
|
+
<tr>
|
|
20
|
+
<th>Family</th>
|
|
21
|
+
<th>Individual</th>
|
|
22
|
+
<th>Father</th>
|
|
23
|
+
<th>Mother</th>
|
|
24
|
+
<th>Proband</th>
|
|
25
|
+
<th>Sex</th>
|
|
26
|
+
<th>Affected</th>
|
|
27
|
+
<th>Phenotypes</th>
|
|
28
|
+
<th>VIBE</th>
|
|
29
|
+
<th />
|
|
30
|
+
</tr>
|
|
31
|
+
</thead>
|
|
32
|
+
<tbody>
|
|
33
|
+
<For each={props.samples.map((sample) => sample.data)}>
|
|
34
|
+
{(sample) => (
|
|
50
35
|
<tr>
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
<
|
|
36
|
+
<td>{sample.item.data.person.familyId}</td>
|
|
37
|
+
<td>
|
|
38
|
+
<A href={href(["samples", sample.item.id])} end={true}>
|
|
39
|
+
{getSampleLabel(sample.item)}
|
|
40
|
+
</A>
|
|
41
|
+
</td>
|
|
42
|
+
<td>{sample.paternalSample ? getSampleLabel(sample.paternalSample) : ""}</td>
|
|
43
|
+
<td>{sample.maternalSample ? getSampleLabel(sample.maternalSample) : ""}</td>
|
|
44
|
+
<td>{sample.item.data.proband ? "True" : "False"}</td>
|
|
45
|
+
<td>{getSampleSexLabel(sample.item)}</td>
|
|
46
|
+
<td>{getSampleAffectedStatusLabel(sample.item)}</td>
|
|
47
|
+
<td>
|
|
48
|
+
<For each={sample.phenotypes}>
|
|
49
|
+
{(phenotypicFeature: PhenotypicFeature, i) => (
|
|
50
|
+
<>
|
|
51
|
+
{i() > 0 ? ", " : ""}
|
|
52
|
+
<HpoTerm ontologyClass={phenotypicFeature.type} />
|
|
53
|
+
</>
|
|
54
|
+
)}
|
|
55
|
+
</For>
|
|
56
|
+
</td>
|
|
57
|
+
<td>
|
|
58
|
+
<Show when={sample.phenotypes.length > 0}>
|
|
59
|
+
<Anchor
|
|
60
|
+
href={`https://vibe.molgeniscloud.org/?phenotypes=${sample.phenotypes
|
|
61
|
+
.map((feature) => feature.type.id)
|
|
62
|
+
.join(",")}`}
|
|
63
|
+
>
|
|
64
|
+
<i class="fas fa-external-link" />
|
|
65
|
+
</Anchor>
|
|
66
|
+
</Show>
|
|
67
|
+
</td>
|
|
68
|
+
<td>
|
|
69
|
+
<button
|
|
70
|
+
class="button is-primary py-1"
|
|
71
|
+
onClick={() => navigate(href(["samples", sample.item.id, "variants"]))}
|
|
72
|
+
>
|
|
73
|
+
Explore Variants
|
|
74
|
+
</button>
|
|
75
|
+
</td>
|
|
61
76
|
</tr>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<tr>
|
|
67
|
-
<td>{sample.data.person.familyId}</td>
|
|
68
|
-
<td>
|
|
69
|
-
<A href={`/samples/${sample.id}`}>{getSampleLabel(sample.data)}</A>
|
|
70
|
-
</td>
|
|
71
|
-
<td>{sampleFatherLabel(sample.data)}</td>
|
|
72
|
-
<td>{sampleMotherLabel(sample.data)}</td>
|
|
73
|
-
<td>{sample.data.proband === true ? "True" : "False"}</td>
|
|
74
|
-
<td>{getSampleSexLabel(sample.data)}</td>
|
|
75
|
-
<td>{getSampleAffectedStatusLabel(sample.data)}</td>
|
|
76
|
-
<td>
|
|
77
|
-
<For each={samplePhenotypes(sample.data)}>
|
|
78
|
-
{(phenotypicFeature: PhenotypicFeature, i) => (
|
|
79
|
-
<>
|
|
80
|
-
{i() > 0 ? ", " : ""}
|
|
81
|
-
<HpoTerm ontologyClass={phenotypicFeature.type} />
|
|
82
|
-
</>
|
|
83
|
-
)}
|
|
84
|
-
</For>
|
|
85
|
-
</td>
|
|
86
|
-
<td>
|
|
87
|
-
<Show when={samplePhenotypes(sample.data).length > 0}>
|
|
88
|
-
<Anchor
|
|
89
|
-
href={`https://vibe.molgeniscloud.org/?phenotypes=${samplePhenotypes(sample.data)
|
|
90
|
-
.map((feature) => feature.type.id)
|
|
91
|
-
.join(",")}`}
|
|
92
|
-
>
|
|
93
|
-
<i class="fas fa-external-link" />
|
|
94
|
-
</Anchor>
|
|
95
|
-
</Show>
|
|
96
|
-
</td>
|
|
97
|
-
<td>
|
|
98
|
-
<button class="button is-primary py-1" onClick={() => navigate(`/samples/${sample.id}/variants`)}>
|
|
99
|
-
Explore Variants
|
|
100
|
-
</button>
|
|
101
|
-
</td>
|
|
102
|
-
</tr>
|
|
103
|
-
)}
|
|
104
|
-
</For>
|
|
105
|
-
</tbody>
|
|
106
|
-
</table>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
77
|
+
)}
|
|
78
|
+
</For>
|
|
79
|
+
</tbody>
|
|
80
|
+
</Table>
|
|
109
81
|
);
|
|
110
82
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { Component, createSignal } from "solid-js";
|
|
1
|
+
import { Component, createEffect, createSignal } from "solid-js";
|
|
2
2
|
|
|
3
3
|
export const SearchBox: Component<{ value?: string | null; onInput: (value: string) => void }> = (props) => {
|
|
4
|
-
const [value, setValue] = createSignal(
|
|
4
|
+
const [value, setValue] = createSignal("");
|
|
5
|
+
|
|
6
|
+
createEffect(() => {
|
|
7
|
+
if (props.value) {
|
|
8
|
+
setValue(props.value);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
5
11
|
|
|
6
12
|
return (
|
|
7
13
|
<div class="field has-addons">
|
package/src/components/Sort.tsx
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
import { Component, For } from "solid-js";
|
|
2
|
-
import { isNumerical } from "../utils/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { isNumerical } from "../utils/vcf.ts";
|
|
3
|
+
import { SortOrder } from "@molgenis/vip-report-api";
|
|
4
|
+
import { DIRECTION_ASCENDING, mapOrder } from "../utils/query/sort.ts";
|
|
5
|
+
import { ConfigSort, ConfigSortOrder } from "../types/configSort";
|
|
6
6
|
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type SortEvent = { order: SortOrder };
|
|
7
|
+
export type SortChangeEvent = { order: SortOrder | SortOrder[] };
|
|
8
|
+
export type SortChangeCallback = (event: SortChangeEvent) => void;
|
|
9
|
+
export type SortClearCallback = () => void;
|
|
13
10
|
|
|
14
11
|
export const Sort: Component<{
|
|
15
|
-
options:
|
|
16
|
-
onChange:
|
|
17
|
-
onClear:
|
|
12
|
+
options: ConfigSort[];
|
|
13
|
+
onChange: SortChangeCallback;
|
|
14
|
+
onClear: SortClearCallback;
|
|
18
15
|
}> = (props) => {
|
|
19
16
|
const sortableOptions = () =>
|
|
20
|
-
props.options.filter((option) =>
|
|
21
|
-
|
|
17
|
+
props.options.filter((option) =>
|
|
18
|
+
option.orders.every((order) => isNumerical(order.field) && order.field.number.count === 1),
|
|
19
|
+
);
|
|
22
20
|
const onSortChange = (event: Event) => {
|
|
23
21
|
const index = Number((event.target as HTMLInputElement).value);
|
|
24
|
-
index === -1
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
if (index === -1) {
|
|
23
|
+
props.onClear();
|
|
24
|
+
} else {
|
|
25
|
+
const sortOption = sortableOptions()[index]!;
|
|
26
|
+
props.onChange({
|
|
27
|
+
order: sortOption.orders.map((order) => mapOrder(order)),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
32
30
|
};
|
|
33
31
|
|
|
32
|
+
function getLabel(orders: ConfigSortOrder[]) {
|
|
33
|
+
return orders.length > 0 && orders[0] !== undefined
|
|
34
|
+
? `${orders[0].field.label || orders[0].field.id} ${orders[0].direction === DIRECTION_ASCENDING ? "(ascending)" : "(descending)"}`
|
|
35
|
+
: " ";
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
return (
|
|
35
39
|
<div class="control">
|
|
36
40
|
<span class="inline-control-text mr-2">Sort by</span>
|
|
@@ -40,8 +44,7 @@ export const Sort: Component<{
|
|
|
40
44
|
<For each={sortableOptions()}>
|
|
41
45
|
{(option, i) => (
|
|
42
46
|
<option value={i()} selected={option.selected === true}>
|
|
43
|
-
{option.
|
|
44
|
-
{option.order.direction === DIRECTION_ASCENDING ? "(ascending)" : "(descending)"}
|
|
47
|
+
{getLabel(option.orders)}
|
|
45
48
|
</option>
|
|
46
49
|
)}
|
|
47
50
|
</For>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ParentComponent } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export const Table: ParentComponent<{
|
|
4
|
+
borderless?: boolean;
|
|
5
|
+
}> = (props) => {
|
|
6
|
+
// workaround for https://github.com/jgthms/bulma/issues/2572#issuecomment-523099776
|
|
7
|
+
return (
|
|
8
|
+
<div style={{ display: "grid" }}>
|
|
9
|
+
<div class="table-container">
|
|
10
|
+
<table classList={{ table: true, "is-narrow": true, "is-borderless": props.borderless }}>
|
|
11
|
+
{props.children}
|
|
12
|
+
</table>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { For, ParentComponent } from "solid-js";
|
|
2
|
+
import { Anchor } from "./Anchor.tsx";
|
|
3
|
+
|
|
4
|
+
export const Tooltip: ParentComponent<{
|
|
5
|
+
text: string | null;
|
|
6
|
+
}> = (props) => {
|
|
7
|
+
const elements = () =>
|
|
8
|
+
props.text
|
|
9
|
+
? props.text
|
|
10
|
+
.split(" ", -1)
|
|
11
|
+
.map((token) => (token.startsWith("http") ? <Anchor href={token}>{token + " "}</Anchor> : token + " "))
|
|
12
|
+
: [];
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div class="tooltip has-background-dark has-text-light">
|
|
16
|
+
<For each={elements()}>{(element) => element}</For>
|
|
17
|
+
{props.children}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Component } from "solid-js";
|
|
2
|
+
import { SampleContainer } from "../utils/api.ts";
|
|
3
|
+
import { VariantType } from "../utils/variantType.ts";
|
|
4
|
+
import { Item } from "@molgenis/vip-report-api";
|
|
5
|
+
import { VcfRecord } from "@molgenis/vip-report-vcf";
|
|
6
|
+
import { getSampleLabel } from "../utils/sample.ts";
|
|
7
|
+
import { getRecordLabel, href } from "../utils/utils.ts";
|
|
8
|
+
import { Breadcrumb, BreadcrumbItem } from "./Breadcrumb.tsx";
|
|
9
|
+
|
|
10
|
+
export const VariantBreadcrumb: Component<{
|
|
11
|
+
variantType: VariantType;
|
|
12
|
+
sample?: SampleContainer;
|
|
13
|
+
record?: Item<VcfRecord>;
|
|
14
|
+
consequenceId?: number;
|
|
15
|
+
}> = (props) => {
|
|
16
|
+
function createBreadcrumbItems(
|
|
17
|
+
variantType: VariantType,
|
|
18
|
+
sample?: SampleContainer,
|
|
19
|
+
record?: Item<VcfRecord>,
|
|
20
|
+
consequenceId?: number,
|
|
21
|
+
) {
|
|
22
|
+
const items: BreadcrumbItem[] = [];
|
|
23
|
+
|
|
24
|
+
const tokens: (string | number)[] = [];
|
|
25
|
+
if (sample) {
|
|
26
|
+
tokens.push("samples");
|
|
27
|
+
items.push({ href: href(tokens), text: "Samples" });
|
|
28
|
+
tokens.push(sample.item.id);
|
|
29
|
+
items.push({ href: href(tokens), text: getSampleLabel(sample.item) });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
tokens.push("variants");
|
|
33
|
+
items.push({ href: href(tokens), text: "Variants" });
|
|
34
|
+
tokens.push(variantType.id);
|
|
35
|
+
items.push({ href: href(tokens), text: variantType.label });
|
|
36
|
+
|
|
37
|
+
if (record) {
|
|
38
|
+
tokens.push("variant");
|
|
39
|
+
tokens.push(record.id);
|
|
40
|
+
items.push({ href: href(tokens), text: getRecordLabel(record) });
|
|
41
|
+
|
|
42
|
+
if (consequenceId !== undefined) {
|
|
43
|
+
tokens.push(consequenceId);
|
|
44
|
+
items.push({ href: href(tokens), text: `Consequence #${consequenceId}` });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return items;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Breadcrumb items={createBreadcrumbItems(props.variantType, props.sample, props.record, props.consequenceId)} />
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Component, Show } from "solid-js";
|
|
2
|
+
import { MetadataContainer, SampleContainer } from "../utils/api.ts";
|
|
3
|
+
import { Value, VcfRecord } from "@molgenis/vip-report-vcf";
|
|
4
|
+
import { DecisionTree, Item, Sample } from "@molgenis/vip-report-api";
|
|
5
|
+
import { VariantInfoTable } from "./VariantInfoTable.tsx";
|
|
6
|
+
import { VariantConsequenceTable } from "./VariantConsequenceTable.tsx";
|
|
7
|
+
import { VariantTable } from "./VariantTable.tsx";
|
|
8
|
+
import { DecisionTreePath } from "./tree/DecisionTreePath.tsx";
|
|
9
|
+
import { getDecisionTreePath, getSampleTreePath } from "../utils/decisionTree.ts";
|
|
10
|
+
import { VariantType } from "../utils/variantType.ts";
|
|
11
|
+
import { getPedigreeSamples } from "../utils/sample.ts";
|
|
12
|
+
import { getInfoField, getInfoValue } from "../utils/vcf.ts";
|
|
13
|
+
import { RuntimeError } from "../utils/error.ts";
|
|
14
|
+
import { ConfigJson } from "../types/config";
|
|
15
|
+
import { VariantGenotypeTable } from "./VariantGenotypeTable.tsx";
|
|
16
|
+
import { initConfig } from "../utils/config/config.ts";
|
|
17
|
+
|
|
18
|
+
export const VariantConsequenceContainer: Component<{
|
|
19
|
+
config: ConfigJson;
|
|
20
|
+
metadata: MetadataContainer;
|
|
21
|
+
variantType: VariantType;
|
|
22
|
+
consequenceId: number;
|
|
23
|
+
record: Item<VcfRecord>;
|
|
24
|
+
sample: SampleContainer | null;
|
|
25
|
+
decisionTree: DecisionTree | null;
|
|
26
|
+
sampleTree: DecisionTree | null;
|
|
27
|
+
}> = (props) => {
|
|
28
|
+
const config = () => initConfig(props.config, props.variantType, props.metadata, props.sample);
|
|
29
|
+
|
|
30
|
+
const samples = (): Item<Sample>[] => (props.sample ? getPedigreeSamples(props.sample) : []);
|
|
31
|
+
const csqField = () => {
|
|
32
|
+
const csqField = getInfoField(props.metadata.records, "CSQ");
|
|
33
|
+
if (csqField === undefined) throw new RuntimeError();
|
|
34
|
+
return csqField;
|
|
35
|
+
};
|
|
36
|
+
const hasDecisionTreePathMeta = () =>
|
|
37
|
+
(props.metadata.records.info.CSQ?.nested?.items || []).findIndex((csq) => csq.id === "VIPP") !== -1;
|
|
38
|
+
const hasSampleTreePathMeta = () => props.metadata.records.format.VIPP_S != null;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<div class="columns">
|
|
43
|
+
<div class="column is-4">
|
|
44
|
+
<div>
|
|
45
|
+
<h1 class="title is-5">Info</h1>
|
|
46
|
+
<VariantInfoTable infoMetadataContainer={props.metadata.records.info} infoContainer={props.record.data.n} />
|
|
47
|
+
</div>
|
|
48
|
+
<div class="mt-3">
|
|
49
|
+
<h1 class="title is-5">Consequence</h1>
|
|
50
|
+
<VariantConsequenceTable
|
|
51
|
+
csqMetadata={csqField().nested?.items || []}
|
|
52
|
+
csqValues={(getInfoValue(props.record, 0, csqField()) as Value[])[props.consequenceId] as Value[]}
|
|
53
|
+
record={props.record}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="mt-3">
|
|
57
|
+
<h1 class="title is-5">Record</h1>
|
|
58
|
+
<VariantTable variant={props.record.data} />
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="column is-8">
|
|
62
|
+
<Show when={config().variant.samplesCells}>
|
|
63
|
+
{(samplesCells) => (
|
|
64
|
+
<div class="column">
|
|
65
|
+
<h1 class="title is-5">Samples</h1>
|
|
66
|
+
<VariantGenotypeTable
|
|
67
|
+
config={samplesCells()}
|
|
68
|
+
samples={samples()}
|
|
69
|
+
metadata={props.metadata}
|
|
70
|
+
variantType={props.variantType}
|
|
71
|
+
record={props.record}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
</Show>
|
|
76
|
+
<div class="columns mt-3">
|
|
77
|
+
{props.decisionTree !== null && hasDecisionTreePathMeta() && (
|
|
78
|
+
<div class="column is-6">
|
|
79
|
+
<h1 class="title is-5">Variant classification tree path</h1>
|
|
80
|
+
<DecisionTreePath
|
|
81
|
+
decisionTree={props.decisionTree}
|
|
82
|
+
path={getDecisionTreePath(props.metadata.records, props.record, props.consequenceId)}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
{props.sampleTree !== null && hasSampleTreePathMeta() && props.sample && (
|
|
87
|
+
<div class="column is-6">
|
|
88
|
+
<h1 class="title is-5">Sample classification tree path</h1>
|
|
89
|
+
<DecisionTreePath
|
|
90
|
+
decisionTree={props.sampleTree}
|
|
91
|
+
path={getSampleTreePath(props.metadata.records, props.sample, props.record, props.consequenceId)}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Component, createMemo, For, Show } from "solid-js";
|
|
2
|
+
import { FieldMetadata, ValueArray, VcfRecord } from "@molgenis/vip-report-vcf";
|
|
3
|
+
import { Item } from "@molgenis/vip-report-api";
|
|
4
|
+
import { FieldTyped } from "./field/typed/FieldTyped.tsx";
|
|
5
|
+
import { Table } from "./Table.tsx";
|
|
6
|
+
import { abbreviateHeader } from "../utils/utils.ts";
|
|
7
|
+
|
|
8
|
+
export const VariantConsequenceTable: Component<{
|
|
9
|
+
csqMetadata: FieldMetadata[];
|
|
10
|
+
csqValues: ValueArray;
|
|
11
|
+
record: Item<VcfRecord>;
|
|
12
|
+
}> = (props) => {
|
|
13
|
+
function getValues(index: number): ValueArray {
|
|
14
|
+
return props.csqValues[index] !== null ? (props.csqValues[index] as ValueArray) : [];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Table borderless={true}>
|
|
19
|
+
<tbody>
|
|
20
|
+
<For each={props.csqMetadata}>
|
|
21
|
+
{(field: FieldMetadata, index) => (
|
|
22
|
+
<Show when={!(getValues(index()).length === 0)}>
|
|
23
|
+
<tr>
|
|
24
|
+
<FieldHeader field={field} />
|
|
25
|
+
<td>
|
|
26
|
+
<FieldTyped metadata={field} value={props.csqValues[index()]} />
|
|
27
|
+
</td>
|
|
28
|
+
</tr>
|
|
29
|
+
</Show>
|
|
30
|
+
)}
|
|
31
|
+
</For>
|
|
32
|
+
</tbody>
|
|
33
|
+
</Table>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const FieldHeader: Component<{
|
|
38
|
+
field: FieldMetadata;
|
|
39
|
+
vertical?: boolean;
|
|
40
|
+
rowspan?: number;
|
|
41
|
+
colspan?: number;
|
|
42
|
+
}> = (props) => {
|
|
43
|
+
const label = createMemo(() => abbreviateHeader(props.field.label || props.field.id));
|
|
44
|
+
return (
|
|
45
|
+
<th
|
|
46
|
+
style={props.vertical ? { "writing-mode": "vertical-rl" } : undefined}
|
|
47
|
+
rowspan={props.rowspan}
|
|
48
|
+
colspan={props.colspan}
|
|
49
|
+
>
|
|
50
|
+
<Show
|
|
51
|
+
when={props.field.description && props.field.description !== label()}
|
|
52
|
+
fallback={<abbr title={props.field.label || props.field.id}>{label()}</abbr>}
|
|
53
|
+
>
|
|
54
|
+
<abbr title={props.field.description}>{label()}</abbr>
|
|
55
|
+
</Show>
|
|
56
|
+
</th>
|
|
57
|
+
);
|
|
58
|
+
};
|