Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Platform]: Variant page review #524

Merged
merged 60 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1fcf8ca
[Platform]: Add latest variant page work to genetics branch (#425)
carcruz Jul 22, 2024
978e6ce
Merge branch 'genetics' of github.com:opentargets/ot-ui-apps into gen…
carcruz Jul 29, 2024
207496d
[Platform]: Update genetics branch (#430)
carcruz Jul 29, 2024
a76f418
[Platform]: Add study page (#431)
gjmcn Jul 29, 2024
7ceac5a
[Platform]: Update VEP widget on variant page (#434)
gjmcn Aug 6, 2024
bffcb69
[Platform]: Use long text for alleles in variant page metadata (#432)
gjmcn Aug 6, 2024
f26325c
[Platform]: Display long variant ID appropriately in variant page hea…
gjmcn Aug 6, 2024
090fc54
[Platform]: Add variant suggestions to home pages (#436)
gjmcn Aug 6, 2024
f3b44cd
[Platform]: Add DisplayVariantId component (#441)
gjmcn Aug 28, 2024
ee82db1
[Platform]: Update VEP columns in variant page (#442)
gjmcn Aug 30, 2024
9e328ea
[Platform]: Add pharmacogenetics widget to variant page (#443)
gjmcn Aug 30, 2024
7284909
[Platform]: Add ClinVar widget to variant page (#447)
gjmcn Aug 30, 2024
f7b373e
[Platform]: Update from VariantIndex to Variant (#453)
gjmcn Sep 2, 2024
1d10d6f
[Platform]: Add QTL credible sets widget to variant page (#456)
gjmcn Sep 4, 2024
d8cbb96
Merge branch 'main' of github.com:opentargets/ot-ui-apps into genetics
carcruz Sep 4, 2024
b465c35
[Platform]: Add GWAS credible set widget to variant page (#454)
gjmcn Sep 4, 2024
9143b52
[Platform]: Update how variant id is shown (#458)
gjmcn Sep 5, 2024
2f2744f
Merge branch 'main' into genetics
gjmcn Sep 12, 2024
99924b8
[Platform]: Add QTL credible sets widget to study page (#465)
gjmcn Sep 17, 2024
faf40ba
[Platform]: Add GWAS credible sets widget to study page (#464)
gjmcn Sep 17, 2024
8f28697
Merge branch 'main' of github.com:opentargets/ot-ui-apps into genetics
carcruz Sep 17, 2024
8ec01e3
[Platform]: Add related GWAS studies widget to study page (#477)
gjmcn Sep 23, 2024
b2c703b
[Platform]: Use page parameter in credible sets queries (#478)
gjmcn Sep 23, 2024
4443faa
[Platform]: Allow greater precision in allele frequency plot (#480)
gjmcn Sep 23, 2024
b9be696
[Platform]: Include variant id in credible sets tooltips (#481)
gjmcn Sep 23, 2024
3fef271
[Platform]: Sort and filter credible sets widgets (#487)
gjmcn Sep 26, 2024
f14d3c4
[Platform]: Include variants in search results (#490)
gjmcn Sep 30, 2024
211b4f2
[Platform] Minor updates to widgets on variant and study pages (#495)
gjmcn Oct 7, 2024
fd1a4a3
[Platform]: Metadata updates for variant and study page (#494)
gjmcn Oct 7, 2024
b5712ab
[Platform] Add links from credible sets widgets to credible set page …
gjmcn Oct 7, 2024
fe74a41
[Platform]: Add credible set page (#492)
gjmcn Oct 7, 2024
fba0e59
[Platform]: Add variants widget to credible set page (#497)
gjmcn Oct 8, 2024
f57dc1e
[Platform]: Handle missing biosample in molQTL credible sets widget o…
gjmcn Oct 8, 2024
39c8f4c
[Platform]: Add GWAS coloc widget to credible set page (#498)
gjmcn Oct 8, 2024
3ce3271
Merge branch 'main' of github.com:opentargets/ot-ui-apps into genetics
carcruz Oct 8, 2024
b959f1f
[Platform] Disable PPP dialog on genetics branch (#501)
gjmcn Oct 9, 2024
ebcf978
[Platform] Increase max rows in coloc widget (#502)
gjmcn Oct 10, 2024
424eedc
[Platform]: Accurate sorting when very small p-values (#500)
gjmcn Oct 10, 2024
6ca7842
[Platform] Add study table to disease page (#505)
gjmcn Oct 22, 2024
6eb0bd1
[Platform] Minor updates to credible sets and study pages (#506)
gjmcn Oct 22, 2024
92bfbd6
[Platform]: Add uniprot widget to variant page (#507)
gjmcn Oct 22, 2024
c39208e
Merge branch 'main' of github.com:opentargets/ot-ui-apps into genetics
carcruz Oct 30, 2024
ef7e7e0
fix: credible set sections
carcruz Oct 30, 2024
0ebbb1c
[Platform]: fix study sections (#513)
carcruz Oct 31, 2024
75067d3
[Platform]: variant page section update (#514)
chinmehta Oct 31, 2024
826dc7d
feat: prop updated
chinmehta Oct 31, 2024
9f52b86
update column id
chinmehta Oct 31, 2024
1b696e8
fix: targetFromSourceId de-structuring
chinmehta Oct 31, 2024
86d8dcd
fix: disease GWASStudiesSection
carcruz Nov 1, 2024
a6031e9
Merge branch 'main' into cm-variant-ux
chinmehta Nov 6, 2024
68b0dd2
Merge branch 'main' into cm-variant-ux
chinmehta Nov 7, 2024
92c146f
sections order update
chinmehta Nov 7, 2024
146df89
merge column
chinmehta Nov 7, 2024
bae1abf
GWASCredibleSets body
chinmehta Nov 7, 2024
82106e7
feat: feedback points
chinmehta Nov 8, 2024
94f4bb3
added column and field called `condition`
chinmehta Nov 8, 2024
ca910e8
tooltip update
chinmehta Nov 8, 2024
60e5761
empty string removed
chinmehta Nov 8, 2024
1749470
refactor: rename VEP widget (#526)
d0choa Nov 8, 2024
640152a
shortname update
chinmehta Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/platform/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_API_URL=https://api.genetics.dev.opentargets.xyz/api/v4/graphql
VITE_API_URL=https://api.platform.dev.opentargets.xyz/api/v4/graphql
VITE_AI_API_URL=https://dev-ai-api-w37vlfsidq-ew.a.run.app
VITE_PROFILE=default
29 changes: 9 additions & 20 deletions apps/platform/src/pages/VariantPage/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,17 @@ import QTLCredibleSetsSummary from "sections/src/variant/QTLCredibleSets/Summary

import client from "../../client";
import ProfileHeader from "./ProfileHeader";
const PharmacogenomicsSection = lazy(
() => import("sections/src/variant/Pharmacogenomics/Body")
);
const PharmacogenomicsSection = lazy(() => import("sections/src/variant/Pharmacogenomics/Body"));
const InSilicoPredictorsSection = lazy(
() => import("sections/src/variant/InSilicoPredictors/Body")
);
const VariantEffectPredictorSection = lazy(
() => import("sections/src/variant/VariantEffectPredictor/Body")
);
const EVASection = lazy(() => import("sections/src/variant/EVA/Body"));
const UniProtVariantsSection = lazy(
() => import("sections/src/variant/UniProtVariants/Body")
);
const GWASCredibleSetsSection = lazy(
() => import("sections/src/variant/GWASCredibleSets/Body")
);
const QTLCredibleSetsSection = lazy(
() => import("sections/src/variant/QTLCredibleSets/Body")
);
const UniProtVariantsSection = lazy(() => import("sections/src/variant/UniProtVariants/Body"));
const GWASCredibleSetsSection = lazy(() => import("sections/src/variant/GWASCredibleSets/Body"));
const QTLCredibleSetsSection = lazy(() => import("sections/src/variant/QTLCredibleSets/Body"));

const summaries = [
PharmacogenomicsSummary,
Expand All @@ -49,10 +41,7 @@ const summaries = [
];

const VARIANT = "variant";
const VARIANT_PROFILE_SUMMARY_FRAGMENT = summaryUtils.createSummaryFragment(
summaries,
"Variant"
);
const VARIANT_PROFILE_SUMMARY_FRAGMENT = summaryUtils.createSummaryFragment(summaries, "Variant");
const VARIANT_PROFILE_QUERY = gql`
query VariantProfileQuery($variantId: String!) {
variant(variantId: $variantId) {
Expand Down Expand Up @@ -80,19 +69,16 @@ function Profile({ varId }: ProfileProps) {
<ProfileHeader />

<SummaryContainer>
<PharmacogenomicsSummary />
<InSilicoPredictorsSummary />
<VariantEffectPredictorSummary />
<EVASummary />
<UniProtVariantsSummary />
<GWASCredibleSetsSummary />
<QTLCredibleSetsSummary />
<PharmacogenomicsSummary />
</SummaryContainer>

<SectionContainer>
<Suspense fallback={<SectionLoader />}>
<PharmacogenomicsSection id={varId} entity={VARIANT} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<InSilicoPredictorsSection id={varId} entity={VARIANT} />
</Suspense>
Expand All @@ -111,6 +97,9 @@ function Profile({ varId }: ProfileProps) {
<Suspense fallback={<SectionLoader />}>
<QTLCredibleSetsSection id={varId} entity={VARIANT} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<PharmacogenomicsSection id={varId} entity={VARIANT} />
</Suspense>
</SectionContainer>
</PlatformApiProvider>
);
Expand Down
5 changes: 5 additions & 0 deletions packages/sections/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,18 @@ export const sourceMap = {

export const clinvarStarMap = {
"practice guideline": 4,
"SuSiE fine-mapped credible set with in-sample LD": 4,
"reviewed by expert panel": 3,
"SuSiE fine-mapped credible set with out-of-sample LD": 3,
"criteria provided, multiple submitters, no conflicts": 2,
"PICS fine-mapped credible set extracted from summary statistics": 2,
"criteria provided, conflicting interpretations": 1,
"criteria provided, single submitter": 1,
"PICS fine-mapped credible set based on reported top hit": 1,
"no assertion for the individual variant": 0,
"no assertion criteria provided": 0,
"no assertion provided": 0,
"Unknown confidence": 0,
};

export const formatMap = {
Expand Down
78 changes: 40 additions & 38 deletions packages/sections/src/variant/GWASCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { useQuery } from "@apollo/client";
import { Link, SectionItem, ScientificNotation, DisplayVariantId, OtTable } from "ui";
import {
Link,
SectionItem,
ScientificNotation,
DisplayVariantId,
OtTable,
Tooltip,
ClinvarStars,
OtScoreLinearBar,
} from "ui";
import { Box, Chip } from "@mui/material";
import { naLabel } from "../../constants";
import { clinvarStarMap, naLabel } from "../../constants";
import { definition } from ".";
import Description from "./Description";
import GWAS_CREDIBLE_SETS_QUERY from "./GWASCredibleSetsQuery.gql";
Expand All @@ -23,11 +32,11 @@ function getColumns({
}: getColumnsType) {
return [
{
id: "view",
label: "Details",
renderCell: ({ studyLocusId }) => <Link to={`../credible-set/${studyLocusId}`}>view</Link>,
filterValue: false,
exportValue: false,
id: "studyLocusId",
label: "More details",
renderCell: ({ studyLocusId }) => (
<Link to={`../credible-set/${studyLocusId}`}>{studyLocusId}</Link>
),
},
{
id: "leadVariant",
Expand Down Expand Up @@ -151,26 +160,18 @@ function getColumns({
exportValue: ({ locus }) => posteriorProbabilities.get(locus)?.toFixed(3),
},
{
id: "ldr2",
label: "LD (r²)",
filterValue: false,
tooltip: (
<>
Linkage disequilibrium with the fixed page variant (
<DisplayVariantId
variantId={id}
referenceAllele={referenceAllele}
alternateAllele={alternateAllele}
expand={false}
/>
).
</>
),
renderCell: ({ locus }) => {
const r2 = locus?.find(obj => obj.variant?.id === id)?.r2Overall;
if (typeof r2 !== "number") return naLabel;
return r2.toFixed(2);
id: "confidence",
label: "Confidence",
sortable: true,
renderCell: ({ confidence }) => {
if (!confidence) return naLabel;
return (
<Tooltip title={confidence} style="">
<ClinvarStars num={clinvarStarMap[confidence]} />
</Tooltip>
);
},
filterValue: ({ confidence }) => clinvarStarMap[confidence],
},
{
id: "finemappingMethod",
Expand All @@ -179,27 +180,28 @@ function getColumns({
{
id: "topL2G",
label: "Top L2G",
filterValue: ({ strongestLocus2gene }) => strongestLocus2gene?.target.approvedSymbol,
filterValue: ({ l2Gpredictions }) => l2Gpredictions?.target.approvedSymbol,
tooltip: "Top gene prioritised by our locus-to-gene model",
renderCell: ({ strongestLocus2gene }) => {
if (!strongestLocus2gene?.target) return naLabel;
const { target } = strongestLocus2gene;
renderCell: ({ l2Gpredictions }) => {
if (!l2Gpredictions[0]?.target) return naLabel;
const { target } = l2Gpredictions[0];
return <Link to={`/target/${target.id}`}>{target.approvedSymbol}</Link>;
},
exportValue: ({ strongestLocus2gene }) => strongestLocus2gene?.target.approvedSymbol,
exportValue: ({ l2Gpredictions }) => l2Gpredictions?.target.approvedSymbol,
},
{
id: "l2gScore",
label: "L2G score",
comparator: (rowA, rowB) =>
rowA?.strongestLocus2gene?.score - rowB?.strongestLocus2gene?.score,
comparator: (rowA, rowB) => rowA?.l2Gpredictions[0]?.score - rowB?.l2Gpredictions[0]?.score,
sortable: true,
filterValue: false,
renderCell: ({ strongestLocus2gene }) => {
if (typeof strongestLocus2gene?.score !== "number") return naLabel;
return strongestLocus2gene.score.toFixed(3);
renderCell: ({ l2Gpredictions }) => {
if (!l2Gpredictions[0]?.score) return naLabel;
return (
<Tooltip title={l2Gpredictions[0].score.toFixed(3)} style="">
<OtScoreLinearBar variant="determinate" value={l2Gpredictions[0].score * 100} />
</Tooltip>
);
},
exportValue: ({ strongestLocus2gene }) => strongestLocus2gene?.score,
},
{
id: "credibleSetSize",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ query GWASCredibleSetsQuery($variantId: String!) {
alternateAllele
credibleSets(studyTypes: [gwas], page: { size: 2000, index: 0 }) {
studyLocusId
pValueMantissa
pValueExponent
beta
finemappingMethod
confidence
variant {
id
chromosome
Expand All @@ -20,18 +25,14 @@ query GWASCredibleSetsQuery($variantId: String!) {
id
}
}
pValueMantissa
pValueExponent
beta
locus {
variant {
id
}
r2Overall
posteriorProbability
}
finemappingMethod
strongestLocus2gene {
l2Gpredictions(size: 1) {
target {
id
approvedSymbol
Expand All @@ -40,4 +41,4 @@ query GWASCredibleSetsQuery($variantId: String!) {
}
}
}
}
}
46 changes: 35 additions & 11 deletions packages/sections/src/variant/QTLCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import { useQuery } from "@apollo/client";
import { Link, SectionItem, ScientificNotation, DisplayVariantId, OtTable } from "ui";
import {
Link,
SectionItem,
ScientificNotation,
DisplayVariantId,
OtTable,
Tooltip,
ClinvarStars,
} from "ui";
import { Box, Chip } from "@mui/material";
import { naLabel } from "../../constants";
import { clinvarStarMap, naLabel } from "../../constants";
import { definition } from ".";
import Description from "./Description";
import QTL_CREDIBLE_SETS_QUERY from "./QTLCredibleSetsQuery.gql";
import { mantissaExponentComparator, variantComparator } from "../../utils/comparators";
import { ReactNode } from "react";

type getColumnsType = {
id: string;
Expand All @@ -22,11 +31,11 @@ function getColumns({
}: getColumnsType) {
return [
{
id: "view",
label: "Details",
renderCell: ({ studyLocusId }) => <Link to={`../credible-set/${studyLocusId}`}>view</Link>,
filterValue: false,
exportValue: false,
id: "studyLocusId",
label: "More details",
renderCell: ({ studyLocusId }) => (
<Link to={`../credible-set/${studyLocusId}`}>{studyLocusId}</Link>
),
},
{
id: "leadVariant",
Expand Down Expand Up @@ -89,22 +98,22 @@ function getColumns({
},
},
{
id: "study.biosample.biosampleId",
id: "study",
label: "Affected tissue/cell",
renderCell: ({ study }) => {
const biosampleId = study?.biosample?.biosampleId;
if (!biosampleId) return naLabel;
return (
<Link external to={`https://www.ebi.ac.uk/ols4/search?q=${biosampleId}&ontology=uberon`}>
{biosampleId}
{study?.biosample?.biosampleName}
</Link>
);
},
},
{
id: "study.condition",
label: "Condition",
renderCell: () => <i>Not in API</i>,
renderCell: ({ study }) => study?.condition || naLabel,
},
{
id: "pValue",
Expand Down Expand Up @@ -133,6 +142,7 @@ function getColumns({
label: "Beta",
filterValue: false,
tooltip: "Beta with respect to the ALT allele",
sortable: true,
renderCell: ({ beta }) => {
if (typeof beta !== "number") return naLabel;
return beta.toPrecision(3);
Expand Down Expand Up @@ -160,6 +170,20 @@ function getColumns({
renderCell: ({ locus }) => posteriorProbabilities.get(locus)?.toFixed(3) ?? naLabel,
exportValue: ({ locus }) => posteriorProbabilities.get(locus)?.toFixed(3),
},
{
id: "confidence",
label: "Confidence",
sortable: true,
renderCell: ({ confidence }) => {
if (!confidence) return naLabel;
return (
<Tooltip title={confidence} style="">
<ClinvarStars num={clinvarStarMap[confidence]} />
</Tooltip>
);
},
filterValue: ({ confidence }) => clinvarStarMap[confidence],
},
{
id: "finemappingMethod",
label: "Finemapping method",
Expand All @@ -181,7 +205,7 @@ type BodyProps = {
entity: string;
};

function Body({ id, entity }: BodyProps) {
function Body({ id, entity }: BodyProps): ReactNode {
const variables = {
variantId: id,
};
Expand Down
14 changes: 8 additions & 6 deletions packages/sections/src/variant/QTLCredibleSets/Description.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ReactElement } from "react";
import { Link, DisplayVariantId } from "ui";

type DescriptionProps = {
Expand All @@ -6,7 +7,11 @@ type DescriptionProps = {
alternateAllele: string;
};

function Description({ variantId, referenceAllele, alternateAllele }: DescriptionProps) {
function Description({
variantId,
referenceAllele,
alternateAllele,
}: DescriptionProps): ReactElement {
return (
<>
molQTL 99% credible sets containing{" "}
Expand All @@ -17,12 +22,9 @@ function Description({ variantId, referenceAllele, alternateAllele }: Descriptio
alternateAllele={alternateAllele}
/>
</strong>
. Source{" "}
<Link external to="https://www.ebi.ac.uk/eqtl/" >
eQTL Catalog
</Link>
. Source <Link to="/">Open Targets</Link>
</>
);
}

export default Description;
export default Description;
Loading
Loading