From 6b9f829dd6fed3988477796d41ed5776ad7e8dc3 Mon Sep 17 00:00:00 2001 From: Riley Grant Date: Fri, 22 Nov 2024 08:56:04 -0600 Subject: [PATCH] fix(browser): correctly sort transcripts without tissue expression --- browser/src/GenePage/sortedTranscripts.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/src/GenePage/sortedTranscripts.ts b/browser/src/GenePage/sortedTranscripts.ts index 59ff69f7f..ad1d8e0c9 100644 --- a/browser/src/GenePage/sortedTranscripts.ts +++ b/browser/src/GenePage/sortedTranscripts.ts @@ -27,8 +27,12 @@ const sortedTranscripts = ( } } - const t1Mean = mean(t1.gtex_tissue_expression!.map((tissue) => tissue.value)) || 0 - const t2Mean = mean(t2.gtex_tissue_expression!.map((tissue) => tissue.value)) || 0 + const t1Mean = t1.gtex_tissue_expression + ? mean(t1.gtex_tissue_expression.map((tissue) => tissue.value)) || 0 + : 0 + const t2Mean = t2.gtex_tissue_expression + ? mean(t2.gtex_tissue_expression.map((tissue) => tissue.value)) || 0 + : 0 if (t1Mean === t2Mean) { return t1.transcript_id.localeCompare(t2.transcript_id)