From 952627b5987f2767d15a02b602ac60c7c53ffccd Mon Sep 17 00:00:00 2001 From: Graham McNeill Date: Wed, 11 Dec 2024 10:19:47 +0000 Subject: [PATCH] [Platform]: Use toPrecision for posterior probabilities #622 --- packages/sections/src/variant/GWASCredibleSets/Body.tsx | 4 ++-- packages/sections/src/variant/QTLCredibleSets/Body.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/sections/src/variant/GWASCredibleSets/Body.tsx b/packages/sections/src/variant/GWASCredibleSets/Body.tsx index d8648641f..b531c9e71 100644 --- a/packages/sections/src/variant/GWASCredibleSets/Body.tsx +++ b/packages/sections/src/variant/GWASCredibleSets/Body.tsx @@ -166,9 +166,9 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { }, sortable: true, renderCell: ({ locus }) => - locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, + locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability.toPrecision(3) : naLabel, exportValue: ({ locus }) => - locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, + locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability : naLabel, }, { id: "finemappingMethod", diff --git a/packages/sections/src/variant/QTLCredibleSets/Body.tsx b/packages/sections/src/variant/QTLCredibleSets/Body.tsx index c9f6d71ea..3ee30a624 100644 --- a/packages/sections/src/variant/QTLCredibleSets/Body.tsx +++ b/packages/sections/src/variant/QTLCredibleSets/Body.tsx @@ -169,9 +169,9 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { ), renderCell: ({ locus }) => - locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, + locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability.toPrecision(3) : naLabel, exportValue: ({ locus }) => - locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability.toFixed(3) : naLabel, + locus.rows.length > 0 ? locus?.rows[0]?.posteriorProbability : naLabel, }, { id: "confidence",