Skip to content

Commit

Permalink
[Platform]: Update molQTL coloc columns on credible set page (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmcn authored Dec 9, 2024
1 parent b19b288 commit c758c62
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
45 changes: 20 additions & 25 deletions packages/sections/src/credibleSet/MolQTLColoc/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 <Link to={`/target/${target.id}`}>{target.approvedSymbol}</Link>;
},
},

{
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 <Link to={`../study/${biosample.biosampleId}`}>{biosample.name}</Link>;
return (
<Link external to={`https://www.ebi.ac.uk/ols4/search?q=${biosample.biosampleId}&ontology=uberon`}>
{biosample.biosampleName}
</Link>
);
},
},
{
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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ query MolQTLColocQuery($studyLocusId: String!, $size: Int!, $index: Int!) {
projectId
traitFromSource
publicationFirstAuthor
condition
target {
approvedSymbol
id
Expand Down

0 comments on commit c758c62

Please sign in to comment.