Skip to content

Commit

Permalink
feat: more types in stores and slot in GenePathogenicityCard (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Feb 5, 2024
1 parent 1fd6611 commit 9be207e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ const props = withDefaults(
<template v-else> No gnomAD constraints </template>
</v-sheet>
</v-col>
<v-col cols="3">
<slot></slot>
</v-col>
</v-row>
</template>
</v-card-text>
Expand Down
12 changes: 7 additions & 5 deletions src/stores/geneInfo/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import { defineStore } from 'pinia'
import { ref } from 'vue'

import { AnnonarsClient } from '../../api/annonars'
import { DottyClient } from '../../api/dotty'
import { DottyClient, TranscriptResult } from '../../api/dotty'
import { type HpoTerm, VigunoClient } from '../../api/viguno'
import { type GenomeBuild } from '../../lib/genomeBuilds'
import { urlConfig } from '../../lib/urlConfig'
import { ClinvarPerGeneRecord } from '../../pbs/annonars/clinvar/per_gene'
import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base'
import { StoreState } from '../types'

export const useGeneInfoStore = defineStore('geneInfo', () => {
Expand All @@ -21,16 +23,16 @@ export const useGeneInfoStore = defineStore('geneInfo', () => {
const hgncId = ref<string | undefined>(undefined)

/** The retrieved gene data from annonars. */
const geneInfo = ref<any | undefined>(undefined)
const geneInfo = ref<GeneInfoRecord | undefined>(undefined)

/** The HPO terms retrieved from viguno. */
const hpoTerms = ref<HpoTerm[]>([])

/** ClinVar gene-related information from annoars. */
const geneClinvar = ref<any | undefined>(undefined)
const geneClinvar = ref<ClinvarPerGeneRecord | undefined>(undefined)

/** Transcript information from dotty (unless dotty API not available). */
const transcripts = ref<any | undefined>(undefined)
const transcripts = ref<TranscriptResult | undefined>(undefined)

function clearData() {
storeState.value = StoreState.Initial
Expand Down Expand Up @@ -88,7 +90,7 @@ export const useGeneInfoStore = defineStore('geneInfo', () => {
hgncIdQuery,
genomeBuild === 'grch37' ? 'GRCh37' : 'GRCh38'
)
transcripts.value = transcriptsData
transcripts.value = transcriptsData ?? undefined
}
} catch (e) {
console.error('There was an error loading the gene data.', e)
Expand Down
8 changes: 7 additions & 1 deletion vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ export default mergeConfig(
provider: 'istanbul',
reporter: ['text', 'html', 'clover', 'json'],
include: [
'src/router/**/*.ts',
'src/router/*.ts',
'src/lib/**/*.ts',
'src/lib/*/*.ts',
'src/stores/**/*.ts',
'src/stores/*/*.ts',
'src/components/**/*.{vue,ts}',
'src/views/**/*.{vue,ts}'
'src/components/*/*.ts',
'src/views/**/*.{vue,ts}',
'src/views/*/*.ts'
],
exclude: ['**/*.spec.ts', '**/*.stories.ts']
},
Expand Down

0 comments on commit 9be207e

Please sign in to comment.