Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ sentence traces back to a cited field. No language model decides or phrases a ve
| Framework | Next.js 15 (App Router) · React 19 |
| Language | TypeScript, strict |
| Styling | Tailwind CSS v4 |
| Helix | Hand-drawn SVG, depth-sorted and CSS-animated |
| 3D | three.js, loaded only when a 3D view is on screen; every shape is generated in code, with no model or image files. The hand-drawn SVG helix stands in until WebGL is ready, and wherever it is unavailable |
| Icons | lucide-react |
| Evidence | NCBI ClinVar and PubMed via E-utilities |

Expand Down Expand Up @@ -179,6 +179,7 @@ variant, classification, frequency and catalogue reading is public and cited.
| **Current evidence** | Live NCBI ClinVar, one batched E-utilities request per sync | `src/lib/clinvar.ts` |
| **Offline fallback** | A saved ClinVar snapshot, verified identical to a live read (15 of 15 records) when it was imported | `src/data/evidence-snapshot.json` |
| **Regional evidence** | gnomAD v4 allele counts for the Middle Eastern genetic ancestry group and all samples, for every variant; and, for three variants, the reading of the Catalogue for Transmission Genetics in Arabs (CTGA, Centre for Arab Genomic Studies), quoted and attributed | `src/data/regional.ts` |
| **Genome map** | GRCh38 chromosome lengths (UCSC hg38) and centromeres (the p11/q11 boundary in the hg38 cytoBand table), fixed properties of the assembly. Each variant stands at the GRCh38 position its ClinVar record gives; a test checks every one against ClinVar's own cytogenetic band | `src/lib/genome.ts` |

With the bundled snapshot, `npm run verify:data` computes: **11 reclassifications** (10 against the
January 2023 release, 1 against the modelled hospital report), **1 consensus conflict**, **2 regional
Expand Down Expand Up @@ -333,11 +334,13 @@ One synthetic patient from historical result to documented review, then how a pa
evaluate it. The same path is linked step by step at the foot of `/pilot`.

1. **Home**. A historical synthetic patient, VP-10247: BRCA1 c.5056C>T, reported in 2023 as
uncertain significance, which is what ClinVar said in its January 2023 release.
uncertain significance, which is what ClinVar said in its January 2023 release. Each bead on
the helix is a monitored finding, coloured by what its evidence did: drag to turn it, and hover
or tab to a bead to see the change (arrow keys move between them).
2. **Run evidence sync**. Reads current ClinVar live (or the verified snapshot offline), compares
classifications, walks the 26 synthetic records and compares regional evidence. It ends on the
highest-priority change: uncertain significance → likely pathogenic, four synthetic patients,
one clinical review case.
classifications, walks the 26 synthetic records and compares regional evidence; a ring scans
along the helix as it runs. It ends on the highest-priority change: uncertain significance →
likely pathogenic, four synthetic patients, one clinical review case.
3. **Open the case**. *What changed?* shows ClinVar's reading then and now, the archived
checkpoints, how the four records were matched, and what limits the evidence.
4. **Take ownership and decide**. Open the review, write a rationale, choose *Refer to genetics*,
Expand All @@ -350,6 +353,10 @@ evaluate it. The same path is linked step by step at the foot of `/pilot`.
`/oversight`, and download the governance package from `/governance`.
8. **Audit trail**. Every action above, with who, which role and when, exportable as CSV or JSON.

`/variants` stands every monitored variant on a to-scale map of the 24 chromosomes; the filters
and the list are linked to it both ways. Each variant's page shows its own chromosome, with the
band and position.

Global search is on `Ctrl`/`Cmd` + `K` and covers record IDs, gene symbols, HGVS strings, ClinVar
accessions and case numbers.

Expand All @@ -370,8 +377,9 @@ account that owns the zone first. To enable AI drafting, add the key as a Worker

## Credits

The helix on the home screen is drawn by VariantPulse itself. An earlier 3D model, licensed for
non-commercial use only, has been removed from the repository.
The helix and the genome map are generated in code by VariantPulse itself: no model, texture or
image file is shipped or fetched. An earlier 3D model, licensed for non-commercial use only, has
been removed from the repository.

---

Expand Down
67 changes: 66 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@
"react": "19.1.0",
"react-dom": "19.1.0",
"server-only": "^0.0.1",
"tailwind-merge": "^3.7.0"
"tailwind-merge": "^3.7.0",
"three": "^0.186.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/three": "^0.186.0",
"esbuild": "^0.28.2",
"eslint": "^9",
"eslint-config-next": "15.5.26",
Expand Down
40 changes: 30 additions & 10 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
Users,
} from "lucide-react";

import { HeroHelix } from "@/components/hero-helix";
import { EvidenceHelix } from "@/components/evidence-helix";
import { ImpactPanel } from "@/components/impact-panel";
import { evidenceModeMeta } from "@/components/story/mode";
import { SyncButton } from "@/components/sync";
Expand All @@ -31,15 +31,15 @@ import { cn, formatDate } from "@/lib/utils";
import { useWorkspace } from "@/state/workspace";

export default function HomePage() {
const { analysis, scanMs } = useWorkspace();
const { analysis, scanMs, sync } = useWorkspace();
// The headline change the story tests pin down, else the top-ranked case, so
// the page always shows a change the dataset really holds.
const lead =
selectStoryAssessment(analysis.assessments) ?? pick(analysis, analysis.reviewableKeys)[0];

return (
<div className="mx-auto w-full max-w-[1360px] space-y-3.5 px-5 pb-3 pt-2 sm:px-6 lg:px-8">
<Hero lead={lead} />
<Hero lead={lead} assessments={analysis.assessments} scanning={sync.phase === "running"} />

<ImpactPanel
findingsChecked={analysis.scan.findingsChecked}
Expand Down Expand Up @@ -94,9 +94,17 @@ export default function HomePage() {

/* -- Hero ------------------------------------------------------------------ */

function Hero({ lead }: { lead: VariantAssessment | undefined }) {
function Hero({
lead,
assessments,
scanning,
}: {
lead: VariantAssessment | undefined;
assessments: VariantAssessment[];
scanning: boolean;
}) {
return (
<section className="grid items-center gap-5 md:grid-cols-[minmax(0,1fr)_240px] min-[86.25rem]:grid-cols-[minmax(0,1fr)_250px_330px]">
<section className="grid items-center gap-5 md:grid-cols-[minmax(0,1fr)_300px] xl:grid-cols-[minmax(0,1fr)_400px] min-[90rem]:grid-cols-[minmax(0,1fr)_360px_310px]">
<div className="py-2">
<h1 className="text-[34px] font-semibold leading-[1.05] tracking-[-0.035em] text-ink sm:text-[42px] min-[86.25rem]:text-[46px]">
The same DNA.
Expand All @@ -108,12 +116,17 @@ function Hero({ lead }: { lead: VariantAssessment | undefined }) {
</p>
</div>

<HeroHelix className="hidden h-[184px] w-full md:block" />
<EvidenceHelix
assessments={assessments}
leadKey={lead?.variant.key ?? null}
scanning={scanning}
className="hidden md:block"
/>

{/* Narrower screens show this card at the foot of the sidebar instead. */}
{/* Only the widest screens have room for this card beside the helix. */}
<Link
href={lead ? `/variants/${encodeURIComponent(lead.variant.key)}` : "/variants"}
className="group hidden rounded-[20px] border border-accent-ring/60 bg-gradient-to-br from-accent-soft to-surface p-5 transition-shadow hover:shadow-[0_14px_34px_-22px_rgba(120,20,50,0.45)] min-[86.25rem]:block"
className="group hidden rounded-[20px] border border-accent-ring/60 bg-gradient-to-br from-accent-soft to-surface p-5 transition-shadow hover:shadow-[0_14px_34px_-22px_rgba(120,20,50,0.45)] min-[90rem]:block"
>
<span className="flex items-start gap-3.5">
<Dna className="h-10 w-10 shrink-0 text-accent/70" strokeWidth={1.3} />
Expand Down Expand Up @@ -305,8 +318,15 @@ function RealExample({ lead }: { lead: VariantAssessment }) {
note={`Reported ${formatDate(variant.recordedOn)}`}
/>
<div className="flex items-center justify-center gap-2 sm:flex-col sm:px-1">
<span className="grid h-9 w-9 place-items-center rounded-full border border-line-2 bg-surface text-ink-2">
<ArrowRight className="h-4 w-4 rotate-90 sm:rotate-0" />
{/* The knowledge-change moment: vermilion, and the one pulse on the page. */}
<span className="relative grid h-9 w-9 place-items-center">
<span
aria-hidden
className="absolute inset-0 rounded-full border border-vermilion/50 [animation:vp-pulse-ring_2.8s_cubic-bezier(0.22,1,0.36,1)_infinite]"
/>
<span className="relative grid h-9 w-9 place-items-center rounded-full border border-vermilion/40 bg-vermilion-soft text-vermilion">
<ArrowRight className="h-4 w-4 rotate-90 sm:rotate-0" />
</span>
</span>
<span className="text-[10px] font-semibold uppercase tracking-[0.12em] text-muted sm:text-center">
Science
Expand Down
19 changes: 19 additions & 0 deletions src/app/variants/[key]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { notFound, useParams } from "next/navigation";
import { ArrowRight, ExternalLink } from "lucide-react";

import { ThenNow } from "@/components/domain";
import { GenomeMap } from "@/components/genome-map";
import { PageHeader, PageShell } from "@/components/page-header";
import {
EvidenceComparison,
Expand All @@ -27,6 +28,7 @@ import {
SectionHeading,
} from "@/components/ui";
import { CHANGE_TYPES } from "@/lib/classification";
import { formatPosition, locusOf } from "@/lib/genome";
import { caseStage } from "@/lib/workflow";
import { WhatChanged } from "@/components/what-changed";
import { composeRecommendation } from "@/lib/narrative";
Expand All @@ -42,6 +44,7 @@ export default function VariantPage() {

const { variant, evidence, changeType, impactedPatients, caseId } = assessment;
const byKey = new Map(analysis.assessments.map((a) => [a.variant.key, a]));
const locus = locusOf(evidence);

return (
<PageShell>
Expand Down Expand Up @@ -130,6 +133,22 @@ export default function VariantPage() {
</div>

<div className="min-w-0 space-y-5">
{locus ? (
<Card className="p-5">
<SectionHeading
title="Where it sits"
description={`Chromosome ${locus.chromosome.name}, ${locus.arm} arm${locus.band ? `, band ${locus.band}` : ""}. GRCh38 position ${formatPosition(locus.position)}, from ClinVar.`}
/>
<GenomeMap
assessments={analysis.assessments}
mode="locus"
focusKey={variant.key}
label={`Chromosome ${locus.chromosome.name} drawn to scale, with ${variant.gene} ${variant.hgvsCoding} marked at ${locus.band ?? "its position"} and any other monitored variant on the same chromosome beside it.`}
className="mt-2"
stageClassName="h-[230px]"
/>
</Card>
) : null}
<ScienceTimeline assessment={assessment} />
<ReasoningPanel assessment={assessment} />
{caseId ? <PriorityPanel assessment={assessment} /> : null}
Expand Down
Loading
Loading