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: integration of meahri 0.8.0 (#56) #103

Merged
merged 2 commits into from
Oct 2, 2023
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
4 changes: 2 additions & 2 deletions frontend/src/api/__tests__/common.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest'

import {
API_INTERNALBASE_PREFIX_MEHARI,
API_INTERNAL_BASE_PREFIX,
API_INTERNAL_BASE_PREFIX_ANNONARS,
API_INTERNAL_BASE_PREFIX_MEHARI,
API_INTERNAL_BASE_PREFIX_NGINX
} from '@/api/common'

Expand All @@ -22,7 +22,7 @@ describe.concurrent('API_BASE_PREFIX constants', () => {

it('returns the correct API base prefix for mehari in production mode', () => {
const originalMode = import.meta.env.MODE
expect(API_INTERNALBASE_PREFIX_MEHARI).toBe('/internal/proxy/mehari')
expect(API_INTERNAL_BASE_PREFIX_MEHARI).toBe('/internal/proxy/mehari')
import.meta.env.MODE = originalMode
})

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const API_INTERNAL_BASE_PREFIX_ANNONARS = '/internal/proxy/annonars'
// ? `//localhost:8080/internal/proxy/annonars`
// : '/internal/proxy/annonars'

export const API_INTERNALBASE_PREFIX_MEHARI = '/internal/proxy/mehari'
export const API_INTERNAL_BASE_PREFIX_MEHARI = '/internal/proxy/mehari'
// import.meta.env.MODE == 'development'
// ? '//localhost:8080/internal/proxy/mehari'
// : '/internal/proxy/mehari'
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/api/mehari.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API_INTERNALBASE_PREFIX_MEHARI } from '@/api/common'
import { API_INTERNAL_BASE_PREFIX_MEHARI } from '@/api/common'

const API_BASE_URL = `${API_INTERNALBASE_PREFIX_MEHARI}/`
const API_BASE_URL = `${API_INTERNAL_BASE_PREFIX_MEHARI}/`

export class MehariClient {
private apiBaseUrl: string
Expand All @@ -19,9 +19,9 @@ export class MehariClient {
alternative: string,
hgnc_id?: string
): Promise<any> {
const hgncSuffix = hgnc_id ? `&hgnc-id=${hgnc_id}` : ''
const hgncSuffix = hgnc_id ? `&hgnc_id=${hgnc_id}` : ''
const url =
`${this.apiBaseUrl}tx/csq?genome-release=${genomeRelease}&` +
`${this.apiBaseUrl}seqvars/csq?genome_release=${genomeRelease}&` +
`chromosome=${chromosome}&position=${pos}&reference=${reference}&` +
`alternative=${alternative}${hgncSuffix}`

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/assets/__tests__/BRCA1TxInfo.json
Git LFS file not shown
10 changes: 5 additions & 5 deletions frontend/src/stores/__tests__/variantInfo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe.concurrent('geneInfo Store', () => {
fetchMocker.mockResponse((req) => {
if (req.url.includes('annos/variant')) {
return Promise.resolve(JSON.stringify(BRCA1VariantInfo))
} else if (req.url.includes('tx/csq')) {
} else if (req.url.includes('seqvars/csq')) {
return Promise.resolve(JSON.stringify(BRCA1TxInfo))
} else if (req.url.includes('genes/info')) {
return Promise.resolve(JSON.stringify(BRCA1GeneInfo))
Expand Down Expand Up @@ -110,7 +110,7 @@ describe.concurrent('geneInfo Store', () => {
return Promise.resolve(
JSON.stringify({ result: { cadd: null, dbnsfp: null, dbscsnv: null } })
)
} else if (req.url.includes('tx/csq')) {
} else if (req.url.includes('seqvars/csq')) {
return Promise.resolve(JSON.stringify(BRCA1TxInfo))
} else if (req.url.includes('genes/info')) {
return Promise.resolve(JSON.stringify(BRCA1GeneInfo))
Expand Down Expand Up @@ -143,7 +143,7 @@ describe.concurrent('geneInfo Store', () => {
fetchMocker.mockResponse((req) => {
if (req.url.includes('annos/variant')) {
return Promise.resolve(JSON.stringify(BRCA1VariantInfo))
} else if (req.url.includes('tx/csq')) {
} else if (req.url.includes('seqvars/csq')) {
return Promise.resolve(JSON.stringify({ result: [] }))
} else if (req.url.includes('genes/info')) {
return Promise.resolve(JSON.stringify(BRCA1GeneInfo))
Expand Down Expand Up @@ -176,7 +176,7 @@ describe.concurrent('geneInfo Store', () => {
fetchMocker.mockResponse((req) => {
if (req.url.includes('annos/variant')) {
return Promise.resolve(JSON.stringify(BRCA1VariantInfo))
} else if (req.url.includes('tx/csq')) {
} else if (req.url.includes('seqvars/csq')) {
return Promise.resolve(JSON.stringify(BRCA1TxInfo))
} else if (req.url.includes('genes/info')) {
return Promise.resolve(JSON.stringify({ genes: null }))
Expand Down Expand Up @@ -207,7 +207,7 @@ describe.concurrent('geneInfo Store', () => {
fetchMocker.mockResponse((req) => {
if (req.url.includes('annos/variant')) {
return Promise.resolve(JSON.stringify(BRCA1VariantInfo))
} else if (req.url.includes('tx/csq')) {
} else if (req.url.includes('seqvars/csq')) {
return Promise.resolve(JSON.stringify(BRCA1TxInfo))
} else if (req.url.includes('genes/info')) {
return Promise.resolve(JSON.stringify(BRCA1GeneInfo))
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/stores/variantAcmgRating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const useVariantAcmgRatingStore = defineStore('variantAcmgRating', () =>
const ref = smallVar.reference
const alt = smallVar.alternative
const response = await fetch(
`${API_BASE_URL}internal/remote/acmg/?release=${release}&chromosome=${chromosome}` +
`${API_BASE_URL}remote/acmg/?release=${release}&chromosome=${chromosome}` +
`&position=${pos}&reference=${ref}&alternative=${alt}`,
{ method: 'GET' }
)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/stores/variantInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const useVariantInfoStore = defineStore('variantInfo', () => {
txCsq.value = txCsqData.result
}

const hgncId: string = txCsqData.result[0]['gene-id']
const hgncId: string = txCsqData.result[0]['gene_id']
const geneData = await annonarsClient.fetchGeneInfo(hgncId)
if (geneData?.genes === null) {
throw new Error('No gene data found.')
Expand Down
Loading