Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust to annonars clinvar_public cardinality changes (#209) #210

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions protos/annonars/clinvar_data/clinvar_public.proto
Original file line number Diff line number Diff line change
Expand Up @@ -731,28 +731,21 @@ message Trait {

/* nested elements */

// names
//
// NB: in XSD this is explictely given as unbounded but XML always has
// one element
// Name(s) of the trait.
repeated GenericSetElement names = 1;
// symbols (NB: never occur in the XML)
repeated GenericSetElement symbols = 2;
// attributes (NB: never occur in the XML)
repeated AttributeSetElement attributes = 3;
// Citation list.
repeated Citation citations = 4;
repeated Citation citations = 2;
// Xref list.
repeated Xref xrefs = 5;
repeated Xref xrefs = 3;
// Comment list.
repeated Comment comments = 6;
repeated Comment comments = 4;
// Sources
repeated string sources = 7;
repeated string sources = 5;

/* attributes */

// Trait type.
Type type = 8;
Type type = 6;
}

// names
Expand Down Expand Up @@ -985,7 +978,7 @@ message AggregateClassificationSet {
// The aggregate germline classification.
optional AggregatedGermlineClassification germline_classification = 1;
// The aggregate somatic clinical impact.
repeated AggregatedSomaticClinicalImpact somatic_clinical_impacts = 2;
optional AggregatedSomaticClinicalImpact somatic_clinical_impact = 2;
// The aggregate oncogenicity classification.
optional AggregatedOncogenicityClassification oncogenicity_classification = 3;
}
Expand Down Expand Up @@ -1116,7 +1109,7 @@ message ClassificationScv {
optional string germline_classification = 2;
// Information on the clinical impact; mutually exlusive with `germline_classification`
// and `oncogenicity_classification`.
optional SomaticClinicalImpact somatic_clinical_impacts = 3;
optional SomaticClinicalImpact somatic_clinical_impact = 3;
// The oncogenicity classification; mutually exlusive with `germline_classification`
// and `oncogenicity_classification`.
optional string oncogenicity_classification = 4;
Expand Down Expand Up @@ -1770,7 +1763,7 @@ message AlleleScv {
// being reported.
repeated Gene genes = 1;
// Name provided by the submitter.
repeated OtherName names = 2;
OtherName name = 2;
// Variant type.
optional string variant_type = 3;
// Location.
Expand Down Expand Up @@ -1811,7 +1804,7 @@ message HaplotypeScv {
// Names other than 'preferred' used for the haplotype.
repeated OtherName other_names = 3;
// Classification of the variant.
optional AggregateClassificationSet classification = 4;
optional AggregateClassificationSet classifications = 4;
// Functional consequences of the variant.
repeated FunctionalConsequence functional_consequences = 5;
// List of attributes.
Expand Down Expand Up @@ -2129,8 +2122,8 @@ message ClinicalAssertion {
// Replaced list; mutually exclusive with replaces
repeated ClinicalAssertionRecordHistory replaceds = 6;

// SCV classifications.
repeated ClassificationScv classifications = 7;
// SCV classification.
ClassificationScv classifications = 7;
// The assertion.
Assertion assertion = 8;
// Attributes.
Expand Down
2 changes: 2 additions & 0 deletions protos/annonars/clinvar_data/gene_impact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ syntax = "proto3";

package annonars.clinvar_data.gene_impact;

import "annonars/clinvar_data/clinvar_public.proto";

// Enumeration with the variant consequence.
enum GeneImpact {
// unspecified impact
Expand Down
18 changes: 3 additions & 15 deletions src/api/annonars/__snapshots__/client.spec.ts.snap

Large diffs are not rendered by default.

23 changes: 4 additions & 19 deletions src/components/SeqvarClinvarCard/SeqvarClinvarCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { ref } from 'vue'

import { ExtractedVcvRecordList } from '../../pbs/annonars/clinvar/minimal'
import { AggregatedSomaticClinicalImpact } from '../../pbs/annonars/clinvar_data/clinvar_public'
import DocsLink from '../DocsLink/DocsLink.vue'
import GermlineClassification from './GermlineClassification.vue'
import RcvRow from './RcvRow.vue'
Expand All @@ -16,17 +15,6 @@ const props = defineProps<{
clinvarRecords?: ExtractedVcvRecordList
}>()

type AggregatedSomaticClinicalImpactU = AggregatedSomaticClinicalImpact | undefined
const clinicalImpacts = computed<AggregatedSomaticClinicalImpactU[]>(() => {
if (!props.clinvarRecords?.records?.length) {
return [undefined]
} else if (props.clinvarRecords?.records[0].classifications?.somaticClinicalImpacts?.length) {
return props.clinvarRecords?.records[0].classifications?.somaticClinicalImpacts
} else {
return [undefined]
}
})

/** Whether the card is expanded; component state. */
const expand = ref<boolean>(false)
</script>
Expand Down Expand Up @@ -66,12 +54,9 @@ const expand = ref<boolean>(false)
</v-row>
<v-row no-gutters class="ml-4 mb-2">
<v-col cols="6">
<template
v-for="somaticClinicalImpact in clinicalImpacts"
:key="somaticClinicalImpact?.description"
>
<SomaticClinicalImpact :clinical-impact="somaticClinicalImpact" />
</template>
<SomaticClinicalImpact
:clinical-impact="clinvarRecord?.classifications?.somaticClinicalImpact"
/>
</v-col>
<v-col cols="6">
<SomaticOncongenicity
Expand Down
32 changes: 10 additions & 22 deletions src/components/StrucvarClinvarCard/StrucvarClinvarCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { computed, ref } from 'vue'
import { type Strucvar } from '../../lib/genomicVars'
import { roundIt } from '../../lib/utils'
import { ResponseRecord as ClinvarSvRecord } from '../../pbs/annonars/clinvar/sv'
import {
AggregateClassificationSet,
AggregatedSomaticClinicalImpact
} from '../../pbs/annonars/clinvar_data/clinvar_public'
import { AggregateClassificationSet } from '../../pbs/annonars/clinvar_data/clinvar_public'
import DocsLink from '../DocsLink/DocsLink.vue'
import {
AGGREGATE_GERMLINE_REVIEW_STATUS_LABEL,
Expand Down Expand Up @@ -64,12 +61,9 @@ const maxStars = (acs: AggregateClassificationSet) => {
const starsOncogenicity = acs.oncogenicityClassification?.reviewStatus
? AGGREGATE_ONCOGENICITY_REVIEW_STATUS_STARS[acs.oncogenicityClassification?.reviewStatus]
: 0
const starsClinicalImpacts = acs.somaticClinicalImpacts.map(
(asci: AggregatedSomaticClinicalImpact): number => {
return AGGREGATE_SOMATIC_CLINICAL_IMPACT_REVIEW_STATUS_STARS[asci.reviewStatus]
}
)
const starsClinicalImpact = Math.max(...starsClinicalImpacts)
const starsClinicalImpact = acs.somaticClinicalImpact?.reviewStatus
? AGGREGATE_SOMATIC_CLINICAL_IMPACT_REVIEW_STATUS_STARS[acs.somaticClinicalImpact?.reviewStatus]
: 0
return Math.max(starsGermline, starsOncogenicity, starsClinicalImpact)
}

Expand Down Expand Up @@ -139,10 +133,7 @@ const expanded = ref<string[]>([])
{{ record!.classifications!.germlineClassification!.description }}
</v-chip>
</div>
<div
v-for="(somaticClinicalImpact, idx) in record!.classifications?.somaticClinicalImpacts"
:key="idx"
>
<div v-if="record!.classifications?.somaticClinicalImpact">
<v-chip
bg-color="grey-darken-4"
title="somatic clinical impact"
Expand All @@ -154,9 +145,9 @@ const expanded = ref<string[]>([])
</v-chip>
<v-chip
density="compact"
:class="`bg-${clinsigColor(somaticClinicalImpact.description)}`"
:class="`bg-${clinsigColor(record!.classifications?.somaticClinicalImpact.description)}`"
>
{{ somaticClinicalImpact.description }}
{{ record!.classifications?.somaticClinicalImpact.description }}
</v-chip>
</div>
<div v-if="record!.classifications?.oncogenicityClassification">
Expand Down Expand Up @@ -215,10 +206,7 @@ const expanded = ref<string[]>([])
</span>
</span>
</div>
<div
v-for="(somaticClinicalImpact, idx) in record!.classifications?.somaticClinicalImpacts"
:key="idx"
>
<div v-if="record!.classifications?.somaticClinicalImpact">
<v-chip
bg-color="grey-darken-4"
title="somatic clinical impact"
Expand All @@ -232,7 +220,7 @@ const expanded = ref<string[]>([])
<span
:title="
AGGREGATE_SOMATIC_CLINICAL_IMPACT_REVIEW_STATUS_LABEL[
somaticClinicalImpact.reviewStatus
record!.classifications?.somaticClinicalImpact.reviewStatus
]
"
>
Expand All @@ -241,7 +229,7 @@ const expanded = ref<string[]>([])
v-if="
i <=
AGGREGATE_SOMATIC_CLINICAL_IMPACT_REVIEW_STATUS_STARS[
somaticClinicalImpact.reviewStatus
record!.classifications?.somaticClinicalImpact.reviewStatus
]
"
>
Expand Down
Loading
Loading