From 3a08b07a48f14268adb64e2103f7fb66b06f1319 Mon Sep 17 00:00:00 2001 From: Simon Malesys <simon.malesys@pasteur.fr> Date: Thu, 6 Feb 2025 16:05:58 +0100 Subject: [PATCH 1/3] Fix TS errors --- src/client/components/AdvancedSearch.vue | 2 +- src/client/store.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/components/AdvancedSearch.vue b/src/client/components/AdvancedSearch.vue index f8a1f5f..21a3c6a 100644 --- a/src/client/components/AdvancedSearch.vue +++ b/src/client/components/AdvancedSearch.vue @@ -177,7 +177,7 @@ </template> <script setup lang="ts"> -import { computed, onMounted, ref } from 'vue' +import { computed, ref } from 'vue' import { useStore } from '../store' import type { AdvancedFilters, FilterChip } from '../types' import AppCheckbox from './AppCheckbox.vue' diff --git a/src/client/store.ts b/src/client/store.ts index ae35b5c..0046d6d 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -13,7 +13,7 @@ import type { FastaHeader, Statistics } from './types' -import alphanumSort from './utils/alphanumSort' +// import alphanumSort from './utils/alphanumSort' export const useStore = defineStore('store', { state: (): AppState => { -- GitLab From 0c6a0fb3870c997729901e37aaa327222486d869 Mon Sep 17 00:00:00 2001 From: Simon Malesys <simon.malesys@pasteur.fr> Date: Thu, 6 Feb 2025 16:17:58 +0100 Subject: [PATCH 2/3] Fix sorting of the segments --- src/client/store.ts | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/src/client/store.ts b/src/client/store.ts index 0046d6d..948e4ec 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -13,7 +13,7 @@ import type { FastaHeader, Statistics } from './types' -// import alphanumSort from './utils/alphanumSort' +import alphanumSort from './utils/alphanumSort' export const useStore = defineStore('store', { state: (): AppState => { @@ -41,11 +41,15 @@ export const useStore = defineStore('store', { return state.statistics?.species || [] }, antibodiesHeavySegments: (state) => { - return Object.keys(state.statistics?.antibodiesPerHeavySegment || {}) + return Object + .keys(state.statistics?.antibodiesPerHeavySegment || {}) + .sort(alphanumSort) }, antibodiesLightSegments: (state) => { - return Object.keys(state.statistics?.antibodiesPerLightSegment || {}) - }, + return Object + .keys(state.statistics?.antibodiesPerLightSegment || {}) + .sort(alphanumSort) + } }, actions: { fetchAntibodies(request: APIFetchParams): void { @@ -94,34 +98,6 @@ export const useStore = defineStore('store', { }) }, - // getAntibodiesSpecies(): void { - // api.getAntibodiesSpecies().then(response => { - // this.antibodiesSpecies = Object.freeze(response.data) - // }).catch((err: AxiosError) => { - // alert(err.message) - // console.log(err) - // }) - // }, - - // getAntibodiesSources(): void { - // api.getAntibodiesSources().then(response => { - // this.antibodiesSources = Object.freeze(response.data) - // }).catch((err: AxiosError) => { - // alert(err.message) - // console.log(err) - // }) - // }, - - // getAntibodiesSegments(): void { - // api.getAntibodiesSegments().then(response => { - // this.antibodiesHeavySegments = Object.freeze(response.data.heavySegments.sort(alphanumSort)) - // this.antibodiesLightSegments = Object.freeze(response.data.lightSegments.sort(alphanumSort)) - // }).catch((err: AxiosError) => { - // alert(err.message) - // console.log(err) - // }) - // }, - getStatistics(): void { api.getStatistics().then(response => { this.statistics = Object.freeze(response.data) -- GitLab From 9c28fb7c5f8ccd4b93fb53f62874fc565c9a976d Mon Sep 17 00:00:00 2001 From: Simon Malesys <simon.malesys@pasteur.fr> Date: Thu, 6 Feb 2025 16:47:54 +0100 Subject: [PATCH 3/3] Fix typos in stats --- data/2025-01-21-stats.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/2025-01-21-stats.json b/data/2025-01-21-stats.json index 0543fbd..a81ba67 100644 --- a/data/2025-01-21-stats.json +++ b/data/2025-01-21-stats.json @@ -50,7 +50,7 @@ "Thera-SAbDab": 754, "EBOLA": 282 }, - "antibodiesPerHeavySegments": { + "antibodiesPerHeavySegment": { "IGHV3": 679792, "IGHV4": 296332, "IGHV7": 10885, @@ -67,7 +67,7 @@ "IGHV11": 68, "IGHV15": 14 }, - "antibodiesPerLightSegments": { + "antibodiesPerLightSegment": { "IGLV4": 15025, "IGLV9": 1703, "IGLV7": 18156, -- GitLab