@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
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Component } from "solid-js";
|
|
2
|
-
import { FilterProps } from "./Filter";
|
|
3
|
-
import { Checkbox, CheckboxEvent } from "../Checkbox";
|
|
4
|
-
import { selector, selectorKey } from "../../utils/query";
|
|
5
|
-
import { Item, Sample, Selector } from "@molgenis/vip-report-api/src/Api";
|
|
6
|
-
|
|
7
|
-
export const FilterIntegerGq: Component<FilterProps> = (props) => {
|
|
8
|
-
const onFilterChange = (event: CheckboxEvent) => {
|
|
9
|
-
const fieldSelector: Selector = ["s", (props.sample as Item<Sample>).data.index, ...selector(props.field)];
|
|
10
|
-
if (event.checked)
|
|
11
|
-
props.onChange({
|
|
12
|
-
key: selectorKey(fieldSelector),
|
|
13
|
-
query: {
|
|
14
|
-
operator: "or",
|
|
15
|
-
args: [
|
|
16
|
-
{
|
|
17
|
-
selector: fieldSelector,
|
|
18
|
-
operator: ">=",
|
|
19
|
-
args: 20,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
selector: fieldSelector,
|
|
23
|
-
operator: "==",
|
|
24
|
-
args: null,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
selector: fieldSelector,
|
|
28
|
-
operator: "==",
|
|
29
|
-
args: undefined,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
else props.onClear({ key: selectorKey(fieldSelector) });
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div class="control">
|
|
39
|
-
<Checkbox
|
|
40
|
-
desc="Genotype quality >= 20"
|
|
41
|
-
label="GT quality >= 20"
|
|
42
|
-
checked={props.query && props.query.args !== undefined}
|
|
43
|
-
onChange={onFilterChange}
|
|
44
|
-
/>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Component, For } from "solid-js";
|
|
2
|
-
import { Checkbox, CheckboxEvent } from "../Checkbox";
|
|
3
|
-
import { FilterProps } from "./Filter";
|
|
4
|
-
import { selector, selectorKey } from "../../utils/query";
|
|
5
|
-
import { Item, Sample, Selector } from "@molgenis/vip-report-api/src/Api";
|
|
6
|
-
|
|
7
|
-
export type CheckboxGroup = {
|
|
8
|
-
[key: string]: boolean;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type CategoryDescriptions = {
|
|
12
|
-
[key: string]: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const labels: CategoryDescriptions = {
|
|
16
|
-
AR_C: "Autosomal Recessive: Compound Hetrozygote",
|
|
17
|
-
AD_IP: "Autosomal Dominant: Incomplete Penentrance",
|
|
18
|
-
AR: "Autosomal Recessive",
|
|
19
|
-
AD: "Autosomal Dominant",
|
|
20
|
-
XLD: "X-Linked Dominant",
|
|
21
|
-
XLR: "X-Linked Recessive",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const FilterVI: Component<FilterProps> = (props) => {
|
|
25
|
-
const group: CheckboxGroup = {};
|
|
26
|
-
if (props.query !== undefined) {
|
|
27
|
-
(props.query?.args as string[]).forEach((key) => {
|
|
28
|
-
group[key] = true;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// enable null category for any_has_any case if someone asks for it (requires query to be composed)
|
|
33
|
-
const fieldSelector: Selector = ["s", (props.sample as Item<Sample>).data.index, ...selector(props.field)];
|
|
34
|
-
const onChange = (event: CheckboxEvent) => {
|
|
35
|
-
group[event.value] = event.checked;
|
|
36
|
-
const values = Object.keys(group).filter((key) => group[key]);
|
|
37
|
-
if (values.length > 0) {
|
|
38
|
-
props.onChange({
|
|
39
|
-
key: selectorKey(fieldSelector),
|
|
40
|
-
query: {
|
|
41
|
-
selector: fieldSelector,
|
|
42
|
-
operator: "has_any",
|
|
43
|
-
args: values,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
props.onClear({ key: selectorKey(fieldSelector) });
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<>
|
|
53
|
-
<For each={props.field.categories}>
|
|
54
|
-
{(category) => (
|
|
55
|
-
<div class="control">
|
|
56
|
-
<Checkbox
|
|
57
|
-
value={category}
|
|
58
|
-
label={category}
|
|
59
|
-
desc={labels[category] !== undefined ? labels[category] : category}
|
|
60
|
-
checked={props.query && (props.query.args as (string | null)[]).includes(category)}
|
|
61
|
-
onChange={onChange}
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
</For>
|
|
66
|
-
</>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { Component } from "solid-js";
|
|
2
|
-
import { Checkbox, CheckboxEvent } from "../Checkbox";
|
|
3
|
-
import { FilterProps } from "./Filter";
|
|
4
|
-
import { selector, selectorKey } from "../../utils/query";
|
|
5
|
-
import { ComposedQuery, Query, QueryClause } from "@molgenis/vip-report-api/src/Api";
|
|
6
|
-
|
|
7
|
-
export type CheckboxGroup = {
|
|
8
|
-
[key: string]: boolean;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type CategoryLabels = {
|
|
12
|
-
[key: string]: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const FilterVariantType: Component<
|
|
16
|
-
FilterProps & {
|
|
17
|
-
labels?: CategoryLabels;
|
|
18
|
-
}
|
|
19
|
-
> = (props) => {
|
|
20
|
-
const group: CheckboxGroup = {};
|
|
21
|
-
let snvChecked = false;
|
|
22
|
-
let strChecked = false;
|
|
23
|
-
let svChecked = false;
|
|
24
|
-
const svSelector = selector(props.field);
|
|
25
|
-
const strQuery: QueryClause = {
|
|
26
|
-
selector: svSelector,
|
|
27
|
-
operator: "==",
|
|
28
|
-
args: "STR",
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const svQuery: ComposedQuery = {
|
|
32
|
-
operator: "and",
|
|
33
|
-
args: [
|
|
34
|
-
{
|
|
35
|
-
selector: svSelector,
|
|
36
|
-
operator: "!=",
|
|
37
|
-
args: "STR",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
selector: svSelector,
|
|
41
|
-
operator: "!=",
|
|
42
|
-
args: null,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
selector: svSelector,
|
|
46
|
-
operator: "!=",
|
|
47
|
-
args: undefined,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const snvQuery: ComposedQuery = {
|
|
53
|
-
operator: "or",
|
|
54
|
-
args: [
|
|
55
|
-
{
|
|
56
|
-
selector: svSelector,
|
|
57
|
-
operator: "==",
|
|
58
|
-
args: null,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
selector: svSelector,
|
|
62
|
-
operator: "==",
|
|
63
|
-
args: undefined,
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
if (props.query !== undefined && props.query.args.length > 0) {
|
|
69
|
-
(props.query.args as Query[]).forEach((childQuery) => {
|
|
70
|
-
if (childQuery.operator == "or") {
|
|
71
|
-
group["SNV"] = true;
|
|
72
|
-
snvChecked = true;
|
|
73
|
-
}
|
|
74
|
-
if (childQuery.operator == "and") {
|
|
75
|
-
group["SV"] = true;
|
|
76
|
-
svChecked = true;
|
|
77
|
-
}
|
|
78
|
-
if (childQuery.operator == "==") {
|
|
79
|
-
group["STR"] = true;
|
|
80
|
-
strChecked = true;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
const onChange = (event: CheckboxEvent) => {
|
|
85
|
-
const queries: Query[] = [];
|
|
86
|
-
group[event.value] = event.checked;
|
|
87
|
-
const values = Object.keys(group).filter((key) => group[key]);
|
|
88
|
-
if (values.length > 0) {
|
|
89
|
-
if (values.includes("SNV")) {
|
|
90
|
-
queries.push(snvQuery);
|
|
91
|
-
snvChecked = true;
|
|
92
|
-
} else {
|
|
93
|
-
snvChecked = false;
|
|
94
|
-
}
|
|
95
|
-
if (values.includes("STR")) {
|
|
96
|
-
queries.push(strQuery);
|
|
97
|
-
strChecked = true;
|
|
98
|
-
} else {
|
|
99
|
-
strChecked = false;
|
|
100
|
-
}
|
|
101
|
-
if (values.includes("SV")) {
|
|
102
|
-
queries.push(svQuery);
|
|
103
|
-
svChecked = true;
|
|
104
|
-
} else {
|
|
105
|
-
svChecked = false;
|
|
106
|
-
}
|
|
107
|
-
props.onChange({
|
|
108
|
-
key: selectorKey(svSelector),
|
|
109
|
-
query: {
|
|
110
|
-
operator: "or",
|
|
111
|
-
args: queries,
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
115
|
-
props.onClear({ key: selectorKey(svSelector) });
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<>
|
|
121
|
-
<p class="has-text-weight-semibold">
|
|
122
|
-
<abbr title={"Only show variants of a certain type (called by a specific variant caller)."}>
|
|
123
|
-
{"Variant type"}
|
|
124
|
-
</abbr>
|
|
125
|
-
</p>
|
|
126
|
-
|
|
127
|
-
<div class="field">
|
|
128
|
-
<div class="control">
|
|
129
|
-
<Checkbox
|
|
130
|
-
value="SNV"
|
|
131
|
-
label="SNV/Indel"
|
|
132
|
-
desc="Single nucleotide variants and short InDels."
|
|
133
|
-
checked={snvChecked}
|
|
134
|
-
onChange={onChange}
|
|
135
|
-
/>
|
|
136
|
-
</div>
|
|
137
|
-
<div class="control">
|
|
138
|
-
<Checkbox value="SV" label="SV" desc="Structural variants." checked={svChecked} onChange={onChange} />
|
|
139
|
-
</div>
|
|
140
|
-
<div class="control">
|
|
141
|
-
<Checkbox value="STR" label="STR" desc="Short Tandem Repeats." checked={strChecked} onChange={onChange} />
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</>
|
|
145
|
-
);
|
|
146
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Component } from "solid-js";
|
|
2
|
-
import { FieldMetadata } from "@molgenis/vip-report-vcf/src/MetadataParser";
|
|
3
|
-
import { Item, Query, Sample } from "@molgenis/vip-report-api/src/Api";
|
|
4
|
-
import { InfoFilters } from "./InfoFilters";
|
|
5
|
-
import { SamplesFilters } from "./SamplesFilters";
|
|
6
|
-
import { FilterQueries } from "../../store";
|
|
7
|
-
|
|
8
|
-
export type FilterChangeEvent = { key: string; query: Query };
|
|
9
|
-
export type FilterClearEvent = { key: string };
|
|
10
|
-
|
|
11
|
-
export const Filters: Component<{
|
|
12
|
-
fields: FieldMetadata[];
|
|
13
|
-
samplesFields: { sample: Item<Sample>; fields: FieldMetadata[] }[];
|
|
14
|
-
queries?: FilterQueries;
|
|
15
|
-
onChange: (event: FilterChangeEvent) => void;
|
|
16
|
-
onClear: (event: FilterClearEvent) => void;
|
|
17
|
-
}> = (props) => {
|
|
18
|
-
return (
|
|
19
|
-
<>
|
|
20
|
-
<InfoFilters fields={props.fields} queries={props.queries} onChange={props.onChange} onClear={props.onClear} />
|
|
21
|
-
<SamplesFilters
|
|
22
|
-
samplesFields={props.samplesFields}
|
|
23
|
-
queries={props.queries}
|
|
24
|
-
onChange={props.onChange}
|
|
25
|
-
onClear={props.onClear}
|
|
26
|
-
/>
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Component } from "solid-js";
|
|
2
|
-
import { Filter, FilterProps } from "./Filter";
|
|
3
|
-
import { FilterChangeEvent, FilterClearEvent } from "./Filters";
|
|
4
|
-
import { ComposedQuery, Query, QueryClause, SelectorPart } from "@molgenis/vip-report-api/src/Api";
|
|
5
|
-
import { selectorKey } from "../../utils/query";
|
|
6
|
-
|
|
7
|
-
export const InfoFilter: Component<FilterProps> = (props) => {
|
|
8
|
-
const onChange = (event: FilterChangeEvent) => {
|
|
9
|
-
props.onChange({
|
|
10
|
-
key: selectorKey(["n", event.key]),
|
|
11
|
-
query: updateQuery(event.query),
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function updateQuery(query: Query): QueryClause | ComposedQuery {
|
|
16
|
-
let updatedQuery: QueryClause | ComposedQuery;
|
|
17
|
-
if ((query as QueryClause).selector !== undefined) {
|
|
18
|
-
updatedQuery = {
|
|
19
|
-
...(query as QueryClause),
|
|
20
|
-
selector: ["n", ...((query as QueryClause).selector as SelectorPart[])],
|
|
21
|
-
};
|
|
22
|
-
} else {
|
|
23
|
-
const queries: (QueryClause | ComposedQuery)[] = [];
|
|
24
|
-
(query as ComposedQuery).args.forEach((subQuery) => queries.push(updateQuery(subQuery)));
|
|
25
|
-
updatedQuery = {
|
|
26
|
-
operator: (query as ComposedQuery).operator,
|
|
27
|
-
args: queries,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return updatedQuery;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const onClear = (event: FilterClearEvent) => {
|
|
34
|
-
props.onClear({
|
|
35
|
-
key: selectorKey(["n", event.key]),
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
return <Filter field={props.field} query={props.query} onChange={onChange} onClear={onClear} />;
|
|
39
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Component, For } from "solid-js";
|
|
2
|
-
import { FieldMetadata } from "@molgenis/vip-report-vcf/src/MetadataParser";
|
|
3
|
-
import { InfoFilter } from "./InfoFilter";
|
|
4
|
-
import { Value } from "@molgenis/vip-report-vcf/src/ValueParser";
|
|
5
|
-
import { FilterQueries } from "../../store";
|
|
6
|
-
import { infoFieldKey } from "../../utils/query";
|
|
7
|
-
import { FilterChangeEvent, FilterClearEvent } from "./Filters";
|
|
8
|
-
|
|
9
|
-
export const InfoFilters: Component<{
|
|
10
|
-
fields: FieldMetadata[];
|
|
11
|
-
queries?: FilterQueries;
|
|
12
|
-
onChange: (event: FilterChangeEvent) => void;
|
|
13
|
-
onClear: (event: FilterClearEvent) => void;
|
|
14
|
-
defaultValues?: { [key: string]: Value };
|
|
15
|
-
}> = (props) => {
|
|
16
|
-
const filterableFields = () =>
|
|
17
|
-
props.fields.filter(
|
|
18
|
-
(field) => field.type === "CATEGORICAL" || field.id === "IncompletePenetrance" || field.id === "SVTYPE",
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<>
|
|
23
|
-
<For each={filterableFields()}>
|
|
24
|
-
{(field) => (
|
|
25
|
-
<InfoFilter
|
|
26
|
-
field={field}
|
|
27
|
-
query={props.queries ? props.queries[infoFieldKey(field)] : undefined}
|
|
28
|
-
onChange={props.onChange}
|
|
29
|
-
onClear={props.onClear}
|
|
30
|
-
/>
|
|
31
|
-
)}
|
|
32
|
-
</For>
|
|
33
|
-
</>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Component, For, Show } from "solid-js";
|
|
2
|
-
import { FieldMetadata } from "@molgenis/vip-report-vcf/src/MetadataParser";
|
|
3
|
-
import { Item, Sample } from "@molgenis/vip-report-api/src/Api";
|
|
4
|
-
import { Filter } from "./Filter";
|
|
5
|
-
import { FilterQueries } from "../../store";
|
|
6
|
-
import { sampleCustomKey, sampleFieldKey } from "../../utils/query";
|
|
7
|
-
import { FilterChangeEvent, FilterClearEvent } from "./Filters";
|
|
8
|
-
import { FilterInheritance } from "./FilterInheritance";
|
|
9
|
-
import { FilterVI } from "./FilterVI";
|
|
10
|
-
|
|
11
|
-
export const SampleFilters: Component<{
|
|
12
|
-
sample: Item<Sample>;
|
|
13
|
-
fields: FieldMetadata[];
|
|
14
|
-
queries?: FilterQueries;
|
|
15
|
-
onChange: (event: FilterChangeEvent) => void;
|
|
16
|
-
onClear: (event: FilterClearEvent) => void;
|
|
17
|
-
}> = (props) => {
|
|
18
|
-
if (props.sample == undefined) {
|
|
19
|
-
throw Error("Cannot create Sample filters without a sample.");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const qualityFields = props.fields.filter((field) => field.id !== "VIM" && field.id !== "VID" && field.id !== "VI");
|
|
23
|
-
let vimField: FieldMetadata | undefined;
|
|
24
|
-
let vidField: FieldMetadata | undefined;
|
|
25
|
-
let viField: FieldMetadata | undefined;
|
|
26
|
-
props.fields.forEach((field) => {
|
|
27
|
-
if (field.id === "VIM") {
|
|
28
|
-
vimField = field;
|
|
29
|
-
} else if (field.id === "VID") {
|
|
30
|
-
vidField = field;
|
|
31
|
-
} else if (field.id === "VI") {
|
|
32
|
-
viField = field;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const inheritanceFilterKey: string = sampleCustomKey(props.sample, "VIP_Inheritance");
|
|
37
|
-
return (
|
|
38
|
-
<>
|
|
39
|
-
<Show when={vimField !== undefined && vidField !== undefined}>
|
|
40
|
-
<abbr class="has-text-weight-semibold" title="Inheritance Match">
|
|
41
|
-
{props.sample.data.person.individualId} Inh. Match
|
|
42
|
-
</abbr>
|
|
43
|
-
<div class="field">
|
|
44
|
-
{" "}
|
|
45
|
-
<FilterInheritance
|
|
46
|
-
vimField={vimField as FieldMetadata}
|
|
47
|
-
vidField={vidField as FieldMetadata}
|
|
48
|
-
query={props.queries ? props.queries[inheritanceFilterKey] : undefined}
|
|
49
|
-
onChange={props.onChange}
|
|
50
|
-
onClear={props.onClear}
|
|
51
|
-
sample={props.sample}
|
|
52
|
-
key={inheritanceFilterKey}
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</Show>
|
|
56
|
-
<Show when={viField !== undefined}>
|
|
57
|
-
<abbr
|
|
58
|
-
class="has-text-weight-semibold"
|
|
59
|
-
title="Inheritance Modes that are suitable for the pedigree genotypes and affected statuses"
|
|
60
|
-
>
|
|
61
|
-
{props.sample.data.person.individualId} Inh. Modes
|
|
62
|
-
</abbr>
|
|
63
|
-
<div class="field">
|
|
64
|
-
{" "}
|
|
65
|
-
<FilterVI
|
|
66
|
-
field={viField as FieldMetadata}
|
|
67
|
-
query={props.queries ? props.queries[sampleFieldKey(props.sample, viField as FieldMetadata)] : undefined}
|
|
68
|
-
onChange={props.onChange}
|
|
69
|
-
onClear={props.onClear}
|
|
70
|
-
sample={props.sample}
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
</Show>
|
|
74
|
-
<p class="has-text-weight-semibold">{props.sample.data.person.individualId}: Quality</p>
|
|
75
|
-
<div class="field">
|
|
76
|
-
<For each={qualityFields}>
|
|
77
|
-
{(field) => (
|
|
78
|
-
<>
|
|
79
|
-
{" "}
|
|
80
|
-
<Filter
|
|
81
|
-
field={field}
|
|
82
|
-
query={props.queries ? props.queries[sampleFieldKey(props.sample, field)] : undefined}
|
|
83
|
-
onChange={props.onChange}
|
|
84
|
-
onClear={props.onClear}
|
|
85
|
-
sample={props.sample}
|
|
86
|
-
/>
|
|
87
|
-
</>
|
|
88
|
-
)}
|
|
89
|
-
</For>
|
|
90
|
-
</div>
|
|
91
|
-
</>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Component, For } from "solid-js";
|
|
2
|
-
import { SampleFilters } from "./SampleFilters";
|
|
3
|
-
import { FieldMetadata } from "@molgenis/vip-report-vcf/src/MetadataParser";
|
|
4
|
-
import { Item, Sample } from "@molgenis/vip-report-api/src/Api";
|
|
5
|
-
import { FilterQueries } from "../../store";
|
|
6
|
-
import { FilterChangeEvent, FilterClearEvent } from "./Filters";
|
|
7
|
-
|
|
8
|
-
export type SampleFields = { sample: Item<Sample>; fields: FieldMetadata[] };
|
|
9
|
-
|
|
10
|
-
export const SamplesFilters: Component<{
|
|
11
|
-
samplesFields: SampleFields[];
|
|
12
|
-
queries?: FilterQueries;
|
|
13
|
-
onChange: (event: FilterChangeEvent) => void;
|
|
14
|
-
onClear: (event: FilterClearEvent) => void;
|
|
15
|
-
}> = (props) => {
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<For each={props.samplesFields}>
|
|
19
|
-
{(sampleField) => (
|
|
20
|
-
<>
|
|
21
|
-
<SampleFilters
|
|
22
|
-
sample={sampleField.sample}
|
|
23
|
-
fields={sampleField.fields}
|
|
24
|
-
queries={props.queries}
|
|
25
|
-
onChange={props.onChange}
|
|
26
|
-
onClear={props.onClear}
|
|
27
|
-
/>
|
|
28
|
-
</>
|
|
29
|
-
)}
|
|
30
|
-
</For>
|
|
31
|
-
</>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Component, createMemo, Match, Switch } from "solid-js";
|
|
2
|
-
import { AlleleBreakend } from "./AlleleBreakend";
|
|
3
|
-
import { AlleleMissing } from "./AlleleMissing";
|
|
4
|
-
import { AlleleSymbolic } from "./AlleleSymbolic";
|
|
5
|
-
import { AlleleNucs } from "./AlleleNucs";
|
|
6
|
-
|
|
7
|
-
type AlleleType = "breakend" | "missing" | "symbolic" | "nucs";
|
|
8
|
-
|
|
9
|
-
export const Allele: Component<{ value: string | null; isAbbreviate: boolean }> = (props) => {
|
|
10
|
-
const type = createMemo((): AlleleType => {
|
|
11
|
-
const value = props.value;
|
|
12
|
-
let type: AlleleType;
|
|
13
|
-
|
|
14
|
-
if (value === null) type = "missing";
|
|
15
|
-
else if (value.startsWith("<") && value.endsWith(">")) type = "symbolic";
|
|
16
|
-
else if (value.indexOf("[") !== -1 || value.indexOf("]") !== -1 || value.indexOf(".") !== -1) type = "breakend";
|
|
17
|
-
else type = "nucs";
|
|
18
|
-
|
|
19
|
-
return type;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Switch>
|
|
24
|
-
<Match when={type() === "breakend"}>
|
|
25
|
-
<AlleleBreakend value={props.value as string} />
|
|
26
|
-
</Match>
|
|
27
|
-
<Match when={type() === "missing"}>
|
|
28
|
-
<AlleleMissing />
|
|
29
|
-
</Match>
|
|
30
|
-
<Match when={type() === "symbolic"}>
|
|
31
|
-
<AlleleSymbolic value={props.value as string} />
|
|
32
|
-
</Match>
|
|
33
|
-
<Match when={type() === "nucs"}>
|
|
34
|
-
<AlleleNucs values={(props.value as string).split("")} isAbbreviate={props.isAbbreviate} />
|
|
35
|
-
</Match>
|
|
36
|
-
</Switch>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Component, For } from "solid-js";
|
|
2
|
-
|
|
3
|
-
const Nucs: Component<{ bases: string[] }> = (props) => {
|
|
4
|
-
return (
|
|
5
|
-
<For each={props.bases}>
|
|
6
|
-
{(base) => (
|
|
7
|
-
<span
|
|
8
|
-
classList={{
|
|
9
|
-
base: true,
|
|
10
|
-
"base-a": base === "A",
|
|
11
|
-
"base-c": base === "C",
|
|
12
|
-
"base-g": base === "G",
|
|
13
|
-
"base-n": base === "N",
|
|
14
|
-
"base-t": base === "T",
|
|
15
|
-
}}
|
|
16
|
-
>
|
|
17
|
-
{base}
|
|
18
|
-
</span>
|
|
19
|
-
)}
|
|
20
|
-
</For>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const AlleleNucs: Component<{ values: string[]; isAbbreviate: boolean }> = (props) => {
|
|
25
|
-
const abbreviate = (): boolean => props.values.length > 4 && props.isAbbreviate;
|
|
26
|
-
|
|
27
|
-
const nucs = (): string[] => {
|
|
28
|
-
let nucs = props.values;
|
|
29
|
-
if (abbreviate()) {
|
|
30
|
-
const lastNuc = nucs[nucs.length - 1];
|
|
31
|
-
nucs = nucs.slice(0, 2);
|
|
32
|
-
nucs.push("\u2026"); // ellipsis
|
|
33
|
-
nucs.push(lastNuc);
|
|
34
|
-
}
|
|
35
|
-
return nucs;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<>
|
|
40
|
-
{abbreviate() ? (
|
|
41
|
-
<abbr title={props.values.join("")}>
|
|
42
|
-
<Nucs bases={nucs()} />
|
|
43
|
-
</abbr>
|
|
44
|
-
) : (
|
|
45
|
-
<Nucs bases={nucs()} />
|
|
46
|
-
)}
|
|
47
|
-
</>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Component, For } from "solid-js";
|
|
2
|
-
import { Allele } from "./Allele";
|
|
3
|
-
|
|
4
|
-
export const Alt: Component<{ value: (string | null)[]; isAbbreviate: boolean }> = (props) => {
|
|
5
|
-
return (
|
|
6
|
-
<>
|
|
7
|
-
<For each={props.value}>
|
|
8
|
-
{(alt, i) => (
|
|
9
|
-
<>
|
|
10
|
-
{i() !== 0 && <span>, </span>}
|
|
11
|
-
<Allele value={alt} isAbbreviate={props.isAbbreviate} />
|
|
12
|
-
</>
|
|
13
|
-
)}
|
|
14
|
-
</For>
|
|
15
|
-
</>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Component, Match, Switch } from "solid-js";
|
|
2
|
-
import { Genotype, RecordSampleType } from "@molgenis/vip-report-vcf/src/SampleDataParser";
|
|
3
|
-
import { Value } from "@molgenis/vip-report-vcf/src/ValueParser";
|
|
4
|
-
import { FieldMetadata } from "@molgenis/vip-report-vcf/src/MetadataParser";
|
|
5
|
-
import { Field } from "./field/Field";
|
|
6
|
-
import { GenotypeField } from "./format/GenotypeField";
|
|
7
|
-
import { Record } from "@molgenis/vip-report-vcf/src/Vcf";
|
|
8
|
-
import { Item } from "@molgenis/vip-report-api/src/Api";
|
|
9
|
-
|
|
10
|
-
export const Format: Component<{
|
|
11
|
-
format: RecordSampleType;
|
|
12
|
-
formatMetadata: FieldMetadata;
|
|
13
|
-
record: Item<Record>;
|
|
14
|
-
isAbbreviate: boolean;
|
|
15
|
-
allelicBalance: number | undefined | null;
|
|
16
|
-
readDepth: number | undefined | null;
|
|
17
|
-
}> = (props) => {
|
|
18
|
-
return (
|
|
19
|
-
<Switch
|
|
20
|
-
fallback={
|
|
21
|
-
<Field
|
|
22
|
-
info={{ value: props.format as Value | Value[], record: props.record }}
|
|
23
|
-
infoMeta={props.formatMetadata}
|
|
24
|
-
context={{}}
|
|
25
|
-
/>
|
|
26
|
-
}
|
|
27
|
-
>
|
|
28
|
-
<Match when={props.formatMetadata.id === "GT"}>
|
|
29
|
-
<GenotypeField
|
|
30
|
-
genotype={props.format as Genotype}
|
|
31
|
-
refAllele={props.record.data.r}
|
|
32
|
-
altAlleles={props.record.data.a}
|
|
33
|
-
isAbbreviate={props.isAbbreviate}
|
|
34
|
-
allelicBalance={props.allelicBalance}
|
|
35
|
-
readDepth={props.readDepth}
|
|
36
|
-
/>
|
|
37
|
-
</Match>
|
|
38
|
-
</Switch>
|
|
39
|
-
);
|
|
40
|
-
};
|