Skip to content

Custom data: "Analyze" opens an analysis of the patients with a row in an upload - #65

Merged
alisman merged 1 commit into
masterfrom
session/custom-data-cohort
Oct 23, 2026
Merged

alisman merged 1 commit into
masterfrom
session/custom-data-cohort

Conversation

@alisman

@alisman alisman commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What changes

New cohort filter: "has a row in this upload"

  • Written {"kind":"upload","dataset":"custom:<name>"}.
  • It selects the patients with a value in any of the upload's columns, for patient- or sample-level uploads. Blank cells are never stored, so a row means a value.
  • It names the upload the way its attributes do. So the document's uploads pins it, and a request without the upload is refused by name, like any custom attribute. CUSTOM_REF_RE now matches both forms.
  • The filter shows as a pill reading "custom data · a row in <name>".
  • It's documented in the DSL reference; docs/dsl.md is regenerated.

"Analyze" button in Custom data → Manage

  • Each saved dataset gets an Analyze button.
  • It opens a new analysis pinned to the dataset's latest version, with one cohort of that filter, across the studies the upload matched.

Preview

  • Sign in, then open Explore → Custom data → Manage → Analyze.
  • Without signing in, the gallery's demo upload shows the filter: /lab?tab=analysis&doc= with a cohort {"study":"luad_mskimpact_2021","all":[{"kind":"upload","dataset":"custom:luad-biopsy-site"}]} gives 93 patients.

Testing

  • Unit tests: the filter's SQL, refusal of a request without the upload, and refusal of a malformed dataset name.
  • e2e (e2e-saved.cjs): saves the example upload, clicks Analyze, and checks the cohort's patient count equals the upload's rows. The saved-data suite passed locally against a signed-in server (8 rows → 8 patients).
  • Typecheck, lint, unit tests (1613) and the DSL doc check pass. The full gate runs on CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TyVfAhLnjshk2kWewGnLum

…n an upload

- A new cohort clause, {"kind":"upload","dataset":"custom:<name>"}: the patients with a value in
  any of the upload's columns, patient- or sample-level. It names the upload as its attributes do,
  so the document's `uploads` pins it and a request without it is refused by name, like any custom
  attribute (CUSTOM_REF_RE matches both forms).
- Each saved dataset in Custom data → Manage gets "Analyze": a new analysis pinned to the latest
  version, with that one cohort, across the studies the upload matched.
- The clause's pill reads "custom data · a row in <name>"; documented in the DSL reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TyVfAhLnjshk2kWewGnLum
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Oct 23, 2026 3:44pm UTC
cohort-lab Ready Ready Preview Oct 23, 2026 3:44pm UTC

Request Review

@alisman
alisman merged commit 94670e5 into master Oct 23, 2026
9 checks passed
@alisman
alisman deleted the session/custom-data-cohort branch October 23, 2026 15:53

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — fd8f70c4 Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant