+
mdi-alert-circle-outline
Variant in homopolymeric region
diff --git a/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/CriterionSwitch.spec.ts b/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/CriterionSwitch.spec.ts
index e69de29b..35a879b1 100644
--- a/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/CriterionSwitch.spec.ts
+++ b/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/CriterionSwitch.spec.ts
@@ -0,0 +1,41 @@
+import { describe, expect, it } from 'vitest'
+
+import CriterionSwitch from '@/components/SeqvarDetails/ClinsigCard/CriterionSwitch.vue'
+import {
+ AcmgCriteria,
+ AcmgEvidenceLevel,
+ MultiSourceAcmgCriteriaState,
+ Presence,
+ StateSource
+} from '@/lib/acmgSeqVar'
+import { setupMountedComponents } from '@/lib/test-utils'
+
+describe.concurrent('CriterionSwitch', async () => {
+ it('renders the CriterionSwitch', async () => {
+ const acmgRating = new MultiSourceAcmgCriteriaState()
+ acmgRating.setPresence(StateSource.User, AcmgCriteria.Pm1, Presence.Present)
+ const { wrapper } = await setupMountedComponents(
+ { component: CriterionSwitch, template: false },
+ {
+ props: {
+ acmgRating: acmgRating,
+ criteria: AcmgCriteria.Pm1,
+ criteriaState: {
+ criteria: AcmgCriteria.Pm1,
+ presence: Presence.Present,
+ evidenceLevel: AcmgEvidenceLevel.PathogenicModerate
+ }
+ }
+ }
+ )
+
+ expect(wrapper.text()).contains('Pm1')
+ expect(wrapper.text()).contains('Pathogenic Moderate')
+ const vSwitch = wrapper.findComponent({ name: 'VSwitch' })
+ const vTooltip = wrapper.findComponent({ name: 'VTooltip' })
+ const vSelect = wrapper.findComponent({ name: 'VSelect' })
+ expect(vSwitch.exists()).toBe(true)
+ expect(vTooltip.exists()).toBe(true)
+ expect(vSelect.exists()).toBe(true)
+ })
+})
diff --git a/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/SummarySheet.spec.ts b/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/SummarySheet.spec.ts
index e69de29b..0e5ea841 100644
--- a/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/SummarySheet.spec.ts
+++ b/frontend/src/components/__tests__/SeqvarDetails/ClinsigCard/SummarySheet.spec.ts
@@ -0,0 +1,20 @@
+import { describe, expect, it } from 'vitest'
+
+import SummarySheet from '@/components/SeqvarDetails/ClinsigCard/SummarySheet.vue'
+import { setupMountedComponents } from '@/lib/test-utils'
+
+describe.concurrent('SummarySheet', async () => {
+ it('renders the SummarySheet', async () => {
+ const { wrapper } = await setupMountedComponents(
+ { component: SummarySheet, template: false },
+ {
+ props: {
+ calculatedAcmgClass: 'Pathogenic'
+ }
+ }
+ )
+
+ expect(wrapper.text()).contains('Semi-Automated ACMG Pathogenicity Prediction')
+ expect(wrapper.text()).contains('Pathogenic')
+ })
+})
diff --git a/frontend/src/components/__tests__/SeqvarDetails/FreqsCard/MitochondrialFreqs.spec.ts b/frontend/src/components/__tests__/SeqvarDetails/FreqsCard/MitochondrialFreqs.spec.ts
index 87accda4..4394910d 100644
--- a/frontend/src/components/__tests__/SeqvarDetails/FreqsCard/MitochondrialFreqs.spec.ts
+++ b/frontend/src/components/__tests__/SeqvarDetails/FreqsCard/MitochondrialFreqs.spec.ts
@@ -1,16 +1,16 @@
import { describe, expect, it } from 'vitest'
import FreqsMitochondrial from '@/components/SeqvarDetails/FreqsCard/MitochondrialFreqs.vue'
+import { type Seqvar } from '@/lib/genomicVars'
import { setupMountedComponents } from '@/lib/test-utils'
-const smallVariantInfo = {
- release: 'grch37',
- chromosome: 'chrM',
- start: '70',
- end: '70',
- reference: 'G',
- alternative: 'A',
- hgnc_id: 'HGNC:1100'
+const seqvarInfo: Seqvar = {
+ genomeBuild: 'grch37',
+ chrom: '17',
+ pos: 43044295,
+ del: 'G',
+ ins: 'A',
+ userRepr: 'grch37-17-43044295-G-A'
}
const variantInfo = {
@@ -37,7 +37,7 @@ describe.concurrent('FreqsMitochondrial', async () => {
{ component: FreqsMitochondrial, template: false },
{
props: {
- smallVar: smallVariantInfo,
+ seqVar: seqvarInfo,
varAnnos: variantInfo
}
}
@@ -55,7 +55,7 @@ describe.concurrent('FreqsMitochondrial', async () => {
{ component: FreqsMitochondrial, template: false },
{
props: {
- smallVar: smallVariantInfo,
+ seqVar: seqvarInfo,
varAnnos: variantInfoNoHelixmtdb
}
}
@@ -73,7 +73,7 @@ describe.concurrent('FreqsMitochondrial', async () => {
{ component: FreqsMitochondrial, template: false },
{
props: {
- smallVar: smallVariantInfo,
+ seqVar: seqvarInfo,
varAnnos: variantInfoNoGnomad
}
}
@@ -89,7 +89,7 @@ describe.concurrent('FreqsMitochondrial', async () => {
{ component: FreqsMitochondrial, template: false },
{
props: {
- smallVar: smallVariantInfo,
+ seqVar: seqvarInfo,
varAnnos: {}
}
}
diff --git a/frontend/src/lib/__tests__/utils.spec.ts b/frontend/src/lib/__tests__/utils.spec.ts
index ef3df4d7..8596a4e4 100644
--- a/frontend/src/lib/__tests__/utils.spec.ts
+++ b/frontend/src/lib/__tests__/utils.spec.ts
@@ -1,5 +1,8 @@
import { describe, expect, it } from 'vitest'
+import { type GenomeBuild } from '@/lib/genomeBuilds'
+import { type Seqvar } from '@/lib/genomicVars'
+
import {
copy,
infoFromQuery,
@@ -10,6 +13,16 @@ import {
separateIt
} from '../utils'
+/** Example Sequence variant. */
+const seqVar: Seqvar = {
+ genomeBuild: 'grch37' as GenomeBuild,
+ chrom: '1',
+ pos: 12345,
+ del: 'A',
+ ins: 'G',
+ userRepr: 'chr1:12345:A:G'
+}
+
describe.concurrent('roundIt method', () => {
it('should round a positive value with default digits', () => {
const result = roundIt(3.14159)
@@ -71,10 +84,14 @@ describe.concurrent('separateIt method', () => {
describe.concurrent('isVariantMt method', () => {
it('should return true if mitochondrial chromosome', () => {
- const result_MT = isVariantMt({ chromosome: 'MT' })
- const result_M = isVariantMt({ chromosome: 'M' })
- const result_chrMT = isVariantMt({ chromosome: 'chrMT' })
- const result_chrM = isVariantMt({ chromosome: 'chrM' })
+ seqVar.chrom = 'MT'
+ const result_MT = isVariantMt(seqVar)
+ seqVar.chrom = 'M'
+ const result_M = isVariantMt(seqVar)
+ seqVar.chrom = 'chrMT'
+ const result_chrMT = isVariantMt(seqVar)
+ seqVar.chrom = 'chrM'
+ const result_chrM = isVariantMt(seqVar)
expect(result_MT).toBe(true)
expect(result_M).toBe(true)
expect(result_chrMT).toBe(true)
@@ -82,29 +99,31 @@ describe.concurrent('isVariantMt method', () => {
})
it('should return false if not mitochondrial chromosome', () => {
- const result = isVariantMt({ chromosome: '1' })
+ seqVar.chrom = '1'
+ const result = isVariantMt(seqVar)
expect(result).toBe(false)
})
})
describe.concurrent('isVariantMtHomopolymer method', () => {
it('should return true if mitochondrial homopolymer', () => {
- const result = isVariantMtHomopolymer({ chromosome: 'MT', start: 70 })
+ seqVar.chrom = 'MT'
+ seqVar.pos = 70
+ const result = isVariantMtHomopolymer(seqVar)
expect(result).toBe(true)
})
it('should return false if not mitochondrial homopolymer (chromosome)', () => {
- const result = isVariantMtHomopolymer({ chromosome: '1', start: 70 })
+ seqVar.chrom = '1'
+ seqVar.pos = 70
+ const result = isVariantMtHomopolymer(seqVar)
expect(result).toBe(false)
})
it('should return false if not mitochondrial homopolymer (position)', () => {
- const result = isVariantMtHomopolymer({ chromosome: 'MT', start: 1 })
- expect(result).toBe(false)
- })
-
- it('should return false for NaN', () => {
- const result = isVariantMtHomopolymer(NaN)
+ seqVar.chrom = 'MT'
+ seqVar.pos = 1
+ const result = isVariantMtHomopolymer(seqVar)
expect(result).toBe(false)
})
})
diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts
index 5475c1f6..60a90733 100644
--- a/frontend/src/lib/utils.ts
+++ b/frontend/src/lib/utils.ts
@@ -1,6 +1,7 @@
import { type RouteLocationNormalizedLoaded, type RouteLocationRaw, type Router } from 'vue-router'
import { type GenomeBuild } from '@/lib/genomeBuilds'
+import { type Seqvar } from '@/lib/genomicVars'
import { type BookmarkData } from '@/stores/bookmarks'
/**
@@ -50,24 +51,24 @@ export const separateIt = (value: number, separator: string = ' '): string => {
/**
* Returns whether the given variant looks mitochondrial.
*
- * @param smallVar Small variant to check.
+ * @param seqvar Small variant to check.
* @returns whether the position is on the mitochondrial genome
*/
-export const isVariantMt = (smallVar: any): boolean => {
- return ['MT', 'M', 'chrMT', 'chrM'].includes(smallVar?.chrom)
+export const isVariantMt = (seqvar: Seqvar): boolean => {
+ return ['MT', 'M', 'chrMT', 'chrM'].includes(seqvar?.chrom)
}
/**
* Returns whether the given position is in a homopolymer on the mitochondrial chromosome.
*
- * @param smallVar Small variant to check.
+ * @param seqvar Small variant to check.
* @returns whether the position is in a mitochondrial homopolymer
*/
-export const isVariantMtHomopolymer = (smallVar: any): boolean => {
- if (!smallVar) {
+export const isVariantMtHomopolymer = (seqvar: Seqvar): boolean => {
+ if (!seqvar) {
return false
}
- const { start, end } = smallVar
+ const { pos } = seqvar
const positionCheck = (pos: number) => {
return (
(pos >= 66 && pos <= 71) ||
@@ -78,8 +79,8 @@ export const isVariantMtHomopolymer = (smallVar: any): boolean => {
(pos >= 16182 && pos <= 16194)
)
}
- if (isVariantMt(smallVar)) {
- return positionCheck(start) || positionCheck(end)
+ if (isVariantMt(seqvar)) {
+ return positionCheck(pos)
} else {
return false
}