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

feat: more types in stores and slot in GenePathogenicityCard #89

Merged
merged 1 commit into from
Feb 5, 2024
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
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
Loading