From f037c7d3dd230e1759fba226c2a3d03a278cbc5a Mon Sep 17 00:00:00 2001 From: Carlos Cruz Date: Wed, 27 Nov 2024 12:26:10 +0000 Subject: [PATCH] [Platform]: fix locus validation on Variant widgets (#564) --- packages/sections/src/variant/GWASCredibleSets/Body.tsx | 6 ++++-- packages/sections/src/variant/QTLCredibleSets/Body.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/sections/src/variant/GWASCredibleSets/Body.tsx b/packages/sections/src/variant/GWASCredibleSets/Body.tsx index 922f0239d..54eeb0edc 100644 --- a/packages/sections/src/variant/GWASCredibleSets/Body.tsx +++ b/packages/sections/src/variant/GWASCredibleSets/Body.tsx @@ -159,8 +159,10 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { comparator: (rowA, rowB) => rowA.locus.rows[0].posteriorProbability - rowB.locus.rows[0].posteriorProbability, sortable: true, - renderCell: ({ locus }) => locus.rows[0]?.posteriorProbability.toFixed(3) ?? naLabel, - exportValue: ({ locus }) => locus.rows[0]?.posteriorProbability.toFixed(3), + renderCell: ({ locus }) => + locus.count > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, + exportValue: ({ locus }) => + locus.count > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, }, { id: "finemappingMethod", diff --git a/packages/sections/src/variant/QTLCredibleSets/Body.tsx b/packages/sections/src/variant/QTLCredibleSets/Body.tsx index 85984167a..187721bf5 100644 --- a/packages/sections/src/variant/QTLCredibleSets/Body.tsx +++ b/packages/sections/src/variant/QTLCredibleSets/Body.tsx @@ -168,8 +168,10 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { comparator: (rowA, rowB) => rowA.locus.rows[0].posteriorProbability - rowB.locus.rows[0].posteriorProbability, sortable: true, - renderCell: ({ locus }) => locus.rows[0]?.posteriorProbability.toFixed(3) ?? naLabel, - exportValue: ({ locus }) => locus.rows[0]?.posteriorProbability.toFixed(3), + renderCell: ({ locus }) => + locus.count > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, + exportValue: ({ locus }) => + locus.count > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, }, { id: "confidence",