Skip to content

Commit

Permalink
molqtl
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmcn committed Nov 28, 2024
1 parent bfc54cb commit 0999b32
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
41 changes: 39 additions & 2 deletions packages/sections/src/credibleSet/GWASMolQTL/Body.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { useQuery } from "@apollo/client";
import { Link, SectionItem, DisplayVariantId, ScientificNotation, OtTable } from "ui";
import {
Link,
SectionItem,
DisplayVariantId,
ScientificNotation,
OtTable,
Tooltip,
} from "ui";
import { naLabel } from "../../constants";
import { definition } from ".";
import Description from "./Description";
Expand All @@ -16,7 +23,7 @@ const columns = [
label: "Navigate",
renderCell: ({ otherStudyLocus }) => {
if (!otherStudyLocus?.variant) return naLabel;
return(<Box sx={{ display: "flex" }}>
return (<Box sx={{ display: "flex" }}>
<Link to={`./${otherStudyLocus.studyLocusId}`}>
<FontAwesomeIcon icon={faArrowRightToBracket} />
</Link>
Expand Down Expand Up @@ -132,6 +139,36 @@ const columns = [
id: "colocalisationMethod",
label: "Colocalisation Method",
},
{
id: "betaRatioSignAverage",
label: "Directionality",
tooltip: "Effect directionality based on the ratio of betas between the two credible sets",
renderCell: ({ betaRatioSignAverage }) => {
if (betaRatioSignAverage == null) return naLabel;
let category = "Inconclusive";
if (betaRatioSignAverage <= -0.99) category = "Opposite";
else if (betaRatioSignAverage >= 0.99) category = "Same";
const displayValue = Math.abs(betaRatioSignAverage) === 1
? betaRatioSignAverage
: betaRatioSignAverage.toFixed(2)
return <Tooltip title={`Beta ratio sign average: ${displayValue}`}>
{category}
</Tooltip>
},
filterValue: ({ betaRatioSignAverage }) => {
if (betaRatioSignAverage == null) return null;
if (betaRatioSignAverage <= -0.99) return "Opposite";
else if (betaRatioSignAverage >= 0.99) return "Same";
return "Inconclusive";
},
sortable: false,
exportValue: ({ betaRatioSignAverage }) => {
if (betaRatioSignAverage == null) return null;
if (betaRatioSignAverage <= -0.99) return "Opposite";
else if (betaRatioSignAverage >= 0.99) return "Same";
return "Inconclusive";
},
},
{
id: "h3",
label: "H3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ query GWASMolQTLColocQuery($studyLocusId: String!) {
h3
h4
clpp
betaRatioSignAverage
}
}
}

0 comments on commit 0999b32

Please sign in to comment.