From 2f9c2bf80a6a6033450b4cc55e433c145dd7f7cd Mon Sep 17 00:00:00 2001 From: Carlos Cruz Date: Thu, 5 Dec 2024 14:00:56 +0000 Subject: [PATCH] [Platform]: fix gwas widget in study (#592) --- .../src/study/GWASCredibleSets/Body.tsx | 22 +++++++++---------- .../GWASCredibleSetsQuery.gql | 12 +++++----- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/sections/src/study/GWASCredibleSets/Body.tsx b/packages/sections/src/study/GWASCredibleSets/Body.tsx index 753423956..3ebfc2c40 100644 --- a/packages/sections/src/study/GWASCredibleSets/Body.tsx +++ b/packages/sections/src/study/GWASCredibleSets/Body.tsx @@ -23,9 +23,7 @@ const columns = [ { id: "studyLocusId", label: "Navigate", - renderCell: ({ studyLocusId }) => ( - - ), + renderCell: ({ studyLocusId }) => , }, { id: "leadVariant", @@ -104,23 +102,25 @@ const columns = [ { id: "topL2G", label: "Top L2G", - filterValue: ({ l2Gpredictions }) => l2Gpredictions?.target.approvedSymbol, + filterValue: ({ l2GPredictions }) => l2GPredictions?.rows[0]?.target.approvedSymbol, tooltip: "Top gene prioritised by our locus-to-gene model", - renderCell: ({ l2Gpredictions }) => { - const target = l2Gpredictions?.[0]?.target; + renderCell: ({ l2GPredictions }) => { + const target = l2GPredictions?.rows[0]?.target; if (!target) return naLabel; return {target.approvedSymbol}; }, - exportValue: ({ l2Gpredictions }) => l2Gpredictions?.target.approvedSymbol, + exportValue: ({ l2GPredictions }) => l2GPredictions?.rows[0]?.target.approvedSymbol, }, { id: "l2gScore", label: "L2G score", - comparator: (rowA, rowB) => rowA?.l2Gpredictions[0]?.score - rowB?.l2Gpredictions[0]?.score, + comparator: (rowA, rowB) => + rowA?.l2GPredictions?.rows[0]?.score - rowB?.l2GPredictions?.rows[0]?.score, sortable: true, - tooltip: "Machine learning prediction linking a gene to a credible set using all features. Score range [0,1].", - renderCell: ({ l2Gpredictions }) => { - const score = l2Gpredictions?.[0]?.score; + tooltip: + "Machine learning prediction linking a gene to a credible set using all features. Score range [0,1].", + renderCell: ({ l2GPredictions }) => { + const score = l2GPredictions?.rows[0]?.score; if (typeof score !== "number") return naLabel; return ( diff --git a/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsQuery.gql b/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsQuery.gql index f95ee8e5d..73ee78ba2 100644 --- a/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsQuery.gql +++ b/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsQuery.gql @@ -20,12 +20,14 @@ query GWASCredibleSetsQuery($studyId: String!, $size: Int!, $index: Int!) { } finemappingMethod confidence - l2Gpredictions(size: 1) { - target { - id - approvedSymbol + l2GPredictions(page: { size: 1, index: 0 }) { + rows { + target { + id + approvedSymbol + } + score } - score } } }