Skip to content

Commit

Permalink
[Platform]: l2GPredictionsschema change (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
carcruz authored Dec 5, 2024
1 parent e291bbb commit f4d01d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
28 changes: 14 additions & 14 deletions packages/sections/src/variant/GWASCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
{
id: "studyLocusId",
label: "Navigate",
renderCell: ({ studyLocusId }) => (
<Navigate to={`/credible-set/${studyLocusId}`} />
),
renderCell: ({ studyLocusId }) => <Navigate to={`/credible-set/${studyLocusId}`} />,
},
{
id: "leadVariant",
Expand Down Expand Up @@ -182,26 +180,28 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
{
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 }) => {
if (!l2Gpredictions[0]?.target) return naLabel;
const { target } = l2Gpredictions[0];
renderCell: ({ l2GPredictions }) => {
if (!l2GPredictions?.rows[0]?.target) return naLabel;
const { target } = l2GPredictions?.rows[0];
return <Link to={`/target/${target.id}`}>{target.approvedSymbol}</Link>;
},
exportValue: ({ l2Gpredictions }) => l2Gpredictions?.target.approvedSymbol,
exportValue: ({ l2GPredictions }) => l2GPredictions?.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 }) => {
if (!l2Gpredictions[0]?.score) return naLabel;
tooltip:
"Machine learning prediction linking a gene to a credible set using all features. Score range [0,1].",
renderCell: ({ l2GPredictions }) => {
if (!l2GPredictions?.rows[0]?.score) return naLabel;
return (
<Tooltip title={l2Gpredictions[0].score.toFixed(3)} style="">
<OtScoreLinearBar variant="determinate" value={l2Gpredictions[0].score * 100} />
<Tooltip title={l2GPredictions?.rows[0].score.toFixed(3)} style="">
<OtScoreLinearBar variant="determinate" value={l2GPredictions?.rows[0].score * 100} />
</Tooltip>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ query GWASCredibleSetsQuery($variantId: String!, $size: Int!, $index: Int!) {
posteriorProbability
}
}
l2Gpredictions(size: 1) {
target {
id
approvedSymbol
l2GPredictions(page: { size: 1, index: 1 }) {
rows {
target {
id
approvedSymbol
}
score
}
score
}
}
}
Expand Down

0 comments on commit f4d01d5

Please sign in to comment.