Skip to content

Commit be06f92

Browse files
authored
Merge pull request #685 from opentargets/gm-l2g-columns
[Platform] Harmonise credible set navigate and L2G score columns
2 parents 5d28810 + 114195a commit be06f92

File tree

9 files changed

+68
-70
lines changed

9 files changed

+68
-70
lines changed

packages/sections/src/credibleSet/GWASColoc/Body.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ import { ReactElement, useEffect, useState } from "react";
1818
const columns = [
1919
{
2020
id: "otherStudyLocus.studyLocusId",
21-
label: "Navigate",
21+
label: "Credible set",
2222
enableHiding: false,
23+
sticky: true,
2324
renderCell: ({ otherStudyLocus }) => {
2425
if (!otherStudyLocus?.variant) return naLabel;
2526
return <Navigate to={`/credible-set/${otherStudyLocus.studyLocusId}`} />;
@@ -188,7 +189,8 @@ const columns = [
188189
{
189190
id: "clpp",
190191
label: "CLPP",
191-
tooltip: "The sum of the products of the fine-mapping posterior probabilities for overlapping variants between two study loci",
192+
tooltip:
193+
"The sum of the products of the fine-mapping posterior probabilities for overlapping variants between two study loci",
192194
numeric: true,
193195
filterValue: false,
194196
comparator: (a, b) => a?.clpp - b?.clpp,

packages/sections/src/credibleSet/MolQTLColoc/Body.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import { useEffect, useState } from "react";
1818
const columns = [
1919
{
2020
id: "otherStudyLocus.studyLocusId",
21-
label: "Navigate",
21+
label: "Credible set",
22+
sticky: true,
2223
renderCell: ({ otherStudyLocus }) => {
2324
if (!otherStudyLocus?.variant) return naLabel;
2425
return <Navigate to={`/credible-set/${otherStudyLocus.studyLocusId}`} />;
@@ -209,7 +210,8 @@ const columns = [
209210
{
210211
id: "clpp",
211212
label: "CLPP",
212-
tooltip: "The sum of the products of the fine-mapping posterior probabilities for overlapping variants between two study loci",
213+
tooltip:
214+
"The sum of the products of the fine-mapping posterior probabilities for overlapping variants between two study loci",
213215
filterValue: false,
214216
numeric: true,
215217
comparator: (a, b) => a?.clpp - b?.clpp,

packages/sections/src/evidence/GWASCredibleSets/Body.jsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,9 @@ function getColumns(targetSymbol, targetId) {
158158
label: "L2G score",
159159
tooltip: (
160160
<>
161-
Causal inference score - see{" "}
162-
<Link
163-
external
164-
to="https://platform-docs.opentargets.org/evidence#open-targets-genetics-portal"
165-
>
161+
Machine learning prediction linking a gene to a credible set using all features. Score
162+
range [0,1]. See{" "}
163+
<Link external to="https://platform-docs.opentargets.org/gentropy/locus-to-gene-l2g">
166164
our documentation
167165
</Link>{" "}
168166
for more information.
@@ -178,15 +176,6 @@ function getColumns(targetSymbol, targetId) {
178176
studyLocusId={credibleSet?.studyLocusId}
179177
/>
180178
);
181-
return (
182-
<Tooltip title={score.toFixed(3)} style="">
183-
<Box sx={{ display: "flex", flexDirection: "row", gap: 1, alignItems: "center" }}>
184-
{score.toFixed(3)}
185-
cee
186-
<OtScoreLinearBar variant="determinate" value={score * 100} />
187-
</Box>
188-
</Tooltip>
189-
);
190179
},
191180
},
192181
{

packages/sections/src/study/GWASCredibleSets/Body.tsx

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
DisplayVariantId,
66
Tooltip,
77
ClinvarStars,
8-
OtScoreLinearBar,
8+
L2GScoreIndicator,
99
OtTable,
1010
useBatchQuery,
1111
Navigate,
@@ -28,8 +28,9 @@ import { ReactElement, useEffect, useState } from "react";
2828
const columns = [
2929
{
3030
id: "studyLocusId",
31-
label: "Navigate",
31+
label: "Credible set",
3232
enableHiding: false,
33+
sticky: true,
3334
renderCell: ({ studyLocusId }) => <Navigate to={`/credible-set/${studyLocusId}`} />,
3435
},
3536
{
@@ -114,7 +115,15 @@ const columns = [
114115
id: "topL2G",
115116
label: "Top L2G",
116117
filterValue: ({ l2GPredictions }) => l2GPredictions?.rows[0]?.target.approvedSymbol,
117-
tooltip: "Top gene prioritised by our locus-to-gene model",
118+
tooltip: (
119+
<>
120+
Top gene prioritised by our locus-to-gene model. See{" "}
121+
<Link external to="https://platform-docs.opentargets.org/gentropy/locus-to-gene-l2g">
122+
our documentation
123+
</Link>{" "}
124+
for more information.
125+
</>
126+
),
118127
renderCell: ({ l2GPredictions }) => {
119128
const target = l2GPredictions?.rows[0]?.target;
120129
if (!target) return naLabel;
@@ -135,16 +144,20 @@ const columns = [
135144
false
136145
),
137146
sortable: true,
138-
tooltip:
139-
"Machine learning prediction linking a gene to a credible set using all features. Score range [0,1].",
140-
renderCell: ({ l2GPredictions }) => {
147+
tooltip: (
148+
<>
149+
Machine learning prediction linking a gene to a credible set using all features. Score range
150+
[0,1]. See{" "}
151+
<Link external to="https://platform-docs.opentargets.org/gentropy/locus-to-gene-l2g">
152+
our documentation
153+
</Link>{" "}
154+
for more information.
155+
</>
156+
),
157+
renderCell: ({ studyLocusId, l2GPredictions }) => {
141158
const score = l2GPredictions?.rows[0]?.score;
142-
if (typeof score !== "number") return naLabel;
143-
return (
144-
<Tooltip title={score.toFixed(3)} style="">
145-
<OtScoreLinearBar variant="determinate" value={score * 100} />
146-
</Tooltip>
147-
);
159+
if (!score) return naLabel;
160+
return <L2GScoreIndicator score={score} studyLocusId={studyLocusId} />;
148161
},
149162
exportValue: ({ l2GPredictions }) => l2GPredictions?.rows[0]?.score,
150163
},

packages/sections/src/study/GWASCredibleSets/ManhattanPlot.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,7 @@ function renderTooltip(datum) {
203203
)}
204204
</Box>
205205
<Box display="flex" alignItems="center" gap={0.5}>
206-
Score:{" "}
207-
{datum.l2GPredictions?.rows?.[0]?.score ? (
208-
<Tooltip title={datum.l2GPredictions.rows[0].score.toFixed(3)} style="">
209-
<div>
210-
<OtScoreLinearBar
211-
variant="determinate"
212-
value={datum.l2GPredictions.rows[0].score * 100}
213-
/>
214-
</div>
215-
</Tooltip>
216-
) : (
217-
naLabel
218-
)}
206+
Score: {datum.l2GPredictions?.rows?.[0]?.score?.toFixed(3) ?? naLabel}
219207
</Box>
220208
</Box>
221209
</ObsTooltipRow>

packages/sections/src/study/QTLCredibleSets/Body.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { mantissaExponentComparator, variantComparator } from "@ot/utils";
99
const columns = [
1010
{
1111
id: "studyLocusId",
12-
label: "Navigate",
12+
label: "Credible set",
13+
sticky: true,
1314
renderCell: ({ studyLocusId }) => <Navigate to={`/credible-set/${studyLocusId}`} />,
1415
},
1516
{

packages/sections/src/variant/GWASCredibleSets/Body.tsx

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
OtTable,
77
Tooltip,
88
ClinvarStars,
9-
OtScoreLinearBar,
9+
L2GScoreIndicator,
1010
useBatchQuery,
1111
Navigate,
1212
} from "ui";
@@ -36,7 +36,8 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
3636
return [
3737
{
3838
id: "studyLocusId",
39-
label: "Navigate",
39+
label: "Credible set",
40+
sticky: true,
4041
enableHiding: false,
4142
renderCell: ({ studyLocusId }) => <Navigate to={`/credible-set/${studyLocusId}`} />,
4243
},
@@ -206,7 +207,15 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
206207
id: "l2Gpredictions",
207208
label: "Top L2G",
208209
filterValue: ({ l2GPredictions }) => l2GPredictions?.rows[0]?.target?.approvedSymbol,
209-
tooltip: "Top gene prioritised by our locus-to-gene model",
210+
tooltip: (
211+
<>
212+
Top gene prioritised by our locus-to-gene model. See{" "}
213+
<Link external to="https://platform-docs.opentargets.org/gentropy/locus-to-gene-l2g">
214+
our documentation
215+
</Link>{" "}
216+
for more information.
217+
</>
218+
),
210219
renderCell: ({ l2GPredictions }) => {
211220
if (!l2GPredictions?.rows[0]?.target) return naLabel;
212221
const { target } = l2GPredictions?.rows[0];
@@ -227,15 +236,20 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
227236
false
228237
),
229238
sortable: true,
230-
tooltip:
231-
"Machine learning prediction linking a gene to a credible set using all features. Score range [0,1].",
232-
renderCell: ({ l2GPredictions }) => {
233-
if (!l2GPredictions?.rows[0]?.score) return naLabel;
234-
return (
235-
<Tooltip title={l2GPredictions?.rows[0].score.toFixed(3)} style="">
236-
<OtScoreLinearBar variant="determinate" value={l2GPredictions?.rows[0].score * 100} />
237-
</Tooltip>
238-
);
239+
tooltip: (
240+
<>
241+
Machine learning prediction linking a gene to a credible set using all features. Score
242+
range [0,1]. See{" "}
243+
<Link external to="https://platform-docs.opentargets.org/gentropy/locus-to-gene-l2g">
244+
our documentation
245+
</Link>{" "}
246+
for more information.
247+
</>
248+
),
249+
renderCell: ({ studyLocusId, l2GPredictions }) => {
250+
const score = l2GPredictions?.rows[0]?.score;
251+
if (!score) return naLabel;
252+
return <L2GScoreIndicator score={score} studyLocusId={studyLocusId} />;
239253
},
240254
exportValue: ({ l2GPredictions }) => l2GPredictions?.rows[0]?.score,
241255
},

packages/sections/src/variant/GWASCredibleSets/PheWasPlot.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -392,19 +392,7 @@ function renderTooltip(datum) {
392392
)}
393393
</Box>
394394
<Box display="flex" alignItems="center" gap={0.5}>
395-
Score:{" "}
396-
{datum.l2GPredictions?.rows?.[0]?.score ? (
397-
<Tooltip title={datum.l2GPredictions.rows[0].score.toFixed(3)} style="">
398-
<div>
399-
<OtScoreLinearBar
400-
variant="determinate"
401-
value={datum.l2GPredictions.rows[0].score * 100}
402-
/>
403-
</div>
404-
</Tooltip>
405-
) : (
406-
naLabel
407-
)}
395+
Score: {datum.l2GPredictions?.rows?.[0]?.score?.toFixed(3) ?? naLabel}
408396
</Box>
409397
</Box>
410398
</ObsTooltipRow>

packages/sections/src/variant/QTLCredibleSets/Body.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
3434
return [
3535
{
3636
id: "studyLocusId",
37-
label: "Navigate",
37+
label: "Credible set",
3838
enableHiding: false,
39+
sticky: true,
3940
renderCell: ({ studyLocusId }) => <Navigate to={`/credible-set/${studyLocusId}`} />,
4041
},
4142
{

0 commit comments

Comments
 (0)