From c758c62d87efd6a9455a18a7528e01766eed3b76 Mon Sep 17 00:00:00 2001 From: Graham McNeill Date: Mon, 9 Dec 2024 15:41:42 +0000 Subject: [PATCH] [Platform]: Update molQTL coloc columns on credible set page (#604) --- .../src/credibleSet/MolQTLColoc/Body.tsx | 45 +++++++++---------- .../MolQTLColoc/MolQTLColocQuery.gql | 1 + 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx b/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx index d7c9e5086..3156448e2 100644 --- a/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx +++ b/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx @@ -13,7 +13,6 @@ import { definition } from "."; import Description from "./Description"; import MOLQTL_COLOC_QUERY from "./MolQTLColocQuery.gql"; import { mantissaExponentComparator, variantComparator } from "../../utils/comparators"; -import { getStudyCategory } from "../../utils/getStudyCategory"; import { useEffect, useState } from "react"; const columns = [ @@ -35,45 +34,41 @@ const columns = [ }, }, { - id: "otherStudyLocus.study.traitFromSource", - label: "Reported trait", + id: "otherStudyLocus.study.studyType", + label: "Type", renderCell: ({ otherStudyLocus }) => { - const trait = otherStudyLocus?.study?.traitFromSource; - if (!trait) return naLabel; - return trait; + const studyType = otherStudyLocus?.study?.studyType; + if (!studyType) return naLabel; + return studyType; }, }, { - id: "otherStudyLocus.study.publicationFirstAuthor", - label: "First author", + id: "otherStudyLocus.study.target.approvedSymbol", + label: "Affected gene", renderCell: ({ otherStudyLocus }) => { - const { projectId, publicationFirstAuthor } = otherStudyLocus?.study || {}; - return getStudyCategory(projectId) === "FINNGEN" - ? "FinnGen" - : publicationFirstAuthor || naLabel; - }, - exportValue: ({ otherStudyLocus }) => { - const { projectId, publicationFirstAuthor } = otherStudyLocus.study || {}; - getStudyCategory(projectId) === "FINNGEN" ? "FinnGen" : publicationFirstAuthor; + const target = otherStudyLocus?.study?.target; + if (!target) return naLabel; + return {target.approvedSymbol}; }, }, + { - id: "otherStudyLocus.study.studyType", + id: "otherStudyLocus.study.biosample.biosampleName", label: "Affected tissue/cell", renderCell: ({ otherStudyLocus }) => { const biosample = otherStudyLocus?.study?.biosample; if (!biosample) return naLabel; - return {biosample.name}; + return ( + + {biosample.biosampleName} + + ); }, }, { - id: "otherStudyLocus.study.studyType", - label: "QTL type", - renderCell: ({ otherStudyLocus }) => { - const studyType = otherStudyLocus?.study?.studyType; - if (!studyType) return naLabel; - return studyType; - }, + id: "otherStudyLocus.study.condition", + label: "Condition", + renderCell: ({ otherStudyLocus }) => otherStudyLocus?.study?.condition || naLabel, }, { id: "otherStudyLocus.variant.id", diff --git a/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql b/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql index 6e7a753f1..29cddc9b6 100644 --- a/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql +++ b/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql @@ -14,6 +14,7 @@ query MolQTLColocQuery($studyLocusId: String!, $size: Int!, $index: Int!) { projectId traitFromSource publicationFirstAuthor + condition target { approvedSymbol id