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 widgets init #380

Merged
merged 23 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7f6211b
feature: Profile and ProfileHeader
gjmcn May 14, 2024
f5cb08b
draft clinvar widget
gjmcn May 21, 2024
1eb57ef
draft UniProt widget
gjmcn May 22, 2024
7ef54ae
[Platform]: partner footer update
chinmehta May 16, 2024
c42c09f
[Package]: migrate LongList component to TypeScript
raskolnikov-rodion May 18, 2024
230492a
[Genetics]: remove log from ScrollToTop component
raskolnikov-rodion May 18, 2024
0f1ddcf
[Package]: migrate CrisprDepmapLink component to TypeScript
raskolnikov-rodion May 18, 2024
6bd0ab9
[Package]: migrate ExternalLink component to TypeScript
raskolnikov-rodion May 18, 2024
6db3c71
[Package]: migrate TepLink component to TypeScript
raskolnikov-rodion May 18, 2024
5d46c02
[Platform]: partner footer update
chinmehta May 16, 2024
a6d1414
[Package]: migrate LongList component to TypeScript
raskolnikov-rodion May 18, 2024
2cd20cd
[Genetics]: remove log from ScrollToTop component
raskolnikov-rodion May 18, 2024
21282ac
[Package]: migrate CrisprDepmapLink component to TypeScript
raskolnikov-rodion May 18, 2024
5a99ea9
[Package]: migrate ExternalLink component to TypeScript
raskolnikov-rodion May 18, 2024
3a0869c
[Package]: migrate TepLink component to TypeScript
raskolnikov-rodion May 18, 2024
a4e0805
Merge branch 'gm-variant-profile' into gm-variant-widgets
gjmcn May 22, 2024
65014db
Merge branch 'main' into gm-variant-profile
gjmcn May 22, 2024
c9fb434
Merge branch 'main' into gm-variant-widgets
gjmcn May 22, 2024
8d47a40
description texts
gjmcn May 23, 2024
decc71a
remove insilico predictors from metadata
gjmcn May 24, 2024
31f63a5
Merge branch 'gm-variant-profile' into gm-variant-widgets
gjmcn May 24, 2024
65fea0a
draft in silico predictors widget
gjmcn May 28, 2024
b4f0513
Merge remote-tracking branch 'origin/ot-variant-page' into gm-variant…
gjmcn May 28, 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
61 changes: 60 additions & 1 deletion apps/platform/src/pages/VariantPage/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,71 @@
import { Suspense, lazy } from "react";
import {
// PlatformApiProvider,
SectionContainer,
SummaryContainer,
SectionLoader,
} from "ui";

import InSilicoPredictorsSummary from "sections/src/variant/InSilicoPredictors/Summary";
import EVASummary from "sections/src/variant/EVA/Summary";
import UniProtVariantsSummary from "sections/src/variant/UniProtVariants/Summary";

import ProfileHeader from "./ProfileHeader";

const InSilicoPredictorsSection = lazy(() => import("sections/src/variant/InSilicoPredictors/Body"));
const EVASection = lazy(() => import("sections/src/variant/EVA/Body"));
const UniProtVariantsSection = lazy(() => import("sections/src/variant/UniProtVariants/Body"));

const summaries = [
InSilicoPredictorsSummary,
EVASummary,
UniProtVariantsSummary
];

const VARIANT = "variant";

// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// TO DO (see e.g. profile.jsx for the evidence page):
// - VARIANT_PROFILE_SUMMARY_FRAGMENT
// - EVIDENCE_PROFILE_QUERY
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

type ProfileProps = {
varId: string;
};

function Profile({ varId }: ProfileProps) {

return <ProfileHeader varId={varId} />
return (
// !!!!!!!!!!
// PUT EVERYTHING INSIDE <PlatformApiProvider> INSTEAD OF FRAGMENT
// !!!!!!!!!!
<>

<ProfileHeader varId={varId} />

<SummaryContainer>
<InSilicoPredictorsSummary />
<EVASummary />
<UniProtVariantsSummary />
</SummaryContainer>

<SectionContainer>
<Suspense fallback={<SectionLoader />}>
<InSilicoPredictorsSection id={varId} label='NO-LABEL!' entity={VARIANT} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<EVASection id={varId} label='NO-LABEL!' entity={VARIANT} />
</Suspense>
<Suspense fallback={<SectionLoader />}>
<UniProtVariantsSection id={varId} label='NO-LABEL!' entity={VARIANT} />
</Suspense>
{/* NEED ANYTHING IN <PrivateWrapper> ???? see evidence page */}
</SectionContainer>

</>

);

}

Expand Down
60 changes: 58 additions & 2 deletions apps/platform/src/pages/VariantPage/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

// ========
// Metadata
// ========

export type AlleleFrequencyType = {
populationName: string;
alleleFrequency: number;
Expand Down Expand Up @@ -37,5 +42,56 @@ export type MetadataType = {
alleleType: string;
alleleFrequencies: AlleleFrequencyType[];
vep: VepType;
inSilicoPredictors: InSilicoPredictorsType;
};
};

// ==================
// InSilicoPredictors
// ==================

export type InSilicoPredictorsType = {
[index: number]: {
method: string,
assesessment?: string,
flag?: string,
score?: number,
}
};

// =======
// ClinVar
// =======

export type ClinVarType = {
alleleOrigins: string[],
alleleRequirements: string[],
approvedSymbol: string,
clinicalSignificances: string[],
cohortPhenotypes: string[],
confidence: string,
directionOnTrait: "risk",
"disease.id": string,
"disease.name": string,
diseaseFromSource: string,
diseaseId: string,
diseaseName: string,
literature: string[],
studyId: string,
targetId: string,
variantId: string,
};

// ===============
// UniProtVariants
// ===============

export type UniProtVariants = {
variantId: string,
confidence: string,
diseaseFromSource: string,
literature: string[],
targetFromSourceId: string,
"target.id": string,
"target.approvedSymbol": string,
"disease.id": string,
"disease.name": string,
};
7 changes: 7 additions & 0 deletions apps/platform/src/sections/variantSections.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { lazy } from "react";

const variantSections = new Map([
["eva", lazy(() => import("sections/src/evidence/EVA/Body"))],
]);

export default variantSections;
Loading
Loading