From 6f0da321f6ddbf5ce842403aea820eedff960ff7 Mon Sep 17 00:00:00 2001 From: Dennis Hendriksen Date: Fri, 1 Jul 2022 08:08:12 +0200 Subject: [PATCH] feat:replace incomplete penetrance column with gene indicator --- src/components/record/info/Gene.tsx | 31 ++++++++++++++++++++--------- src/views/SampleVariants.tsx | 1 - 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/components/record/info/Gene.tsx b/src/components/record/info/Gene.tsx index c096ab3b..49e9e6e2 100644 --- a/src/components/record/info/Gene.tsx +++ b/src/components/record/info/Gene.tsx @@ -1,24 +1,25 @@ import { Component, createMemo, Show } from "solid-js"; import { Anchor } from "../../Anchor"; import { FieldProps } from "../field/Field"; -import { ValueString } from "@molgenis/vip-report-vcf/src/ValueParser"; +import { ValueFlag, ValueString } from "@molgenis/vip-report-vcf/src/ValueParser"; import { getCsqInfo, getCsqInfoIndex } from "../../../utils/csqUtils"; +import { Abbr } from "../../Abbr"; export const Gene: Component = (props) => { - const symbol = (): string | null => props.info.value as ValueString; + const symbol = (): ValueString => props.info.value as ValueString; - const symbolSource = createMemo((): string | undefined => { + const symbolSource = createMemo((): ValueString | undefined => { if (symbol() === null) return undefined; const symbolSourceFieldIndex = getCsqInfoIndex(props.infoMeta, "SYMBOL_SOURCE"); - return symbolSourceFieldIndex !== -1 ? (getCsqInfo(props.info, symbolSourceFieldIndex) as string) : undefined; + return symbolSourceFieldIndex !== -1 ? (getCsqInfo(props.info, symbolSourceFieldIndex) as ValueString) : undefined; }); - const geneId = createMemo((): string | undefined => { + const geneId = createMemo((): ValueString | undefined => { if (symbol() === null) return undefined; const geneFieldIndex = getCsqInfoIndex(props.infoMeta, "Gene"); - return geneFieldIndex !== -1 ? (getCsqInfo(props.info, geneFieldIndex) as string) : undefined; + return geneFieldIndex !== -1 ? (getCsqInfo(props.info, geneFieldIndex) as ValueString) : undefined; }); const href = (): string | undefined => { @@ -31,12 +32,24 @@ export const Gene: Component = (props) => { return `https://www.genenames.org/tools/search/#!/?${queryString}`; }; + const incompletePenetrance = (): ValueFlag | undefined => { + const ipFieldIndex = getCsqInfoIndex(props.infoMeta, "IncompletePenetrance"); + return ipFieldIndex !== -1 ? (getCsqInfo(props.info, ipFieldIndex) as ValueFlag) : undefined; + }; + return ( {(symbol) => ( - - {symbol} - + <> + + {symbol} + + {incompletePenetrance() && ( + + + + )} + )} ); diff --git a/src/views/SampleVariants.tsx b/src/views/SampleVariants.tsx index 315032bb..f14d827e 100644 --- a/src/views/SampleVariants.tsx +++ b/src/views/SampleVariants.tsx @@ -122,7 +122,6 @@ export const SampleVariants: Component<{ "Consequence", "SYMBOL", "InheritanceModesGene", - "IncompletePenetrance", "HPO", "HGVSc", "HGVSp",