Skip to content

feat: add Variables tab to study detail page #163

@NoopDog

Description

@NoopDog

Summary

Add a "Variables" tab to the study detail page that shows the variables measured in each dbGaP study, organized by concept category.

Requirements

1. Category Tree Display

Variables are grouped into a tree using the existing classification hierarchy:

NCPI Category (e.g. "ncpi:biomarkers")
  └─ Concept (e.g. "topmed:hdl_cholesterol")
       └─ Variable (e.g. "HDL - HDL cholesterol mg/dL")  ← only for small studies
  • Only show populated categories — omit any NCPI category or concept with zero variables in the study.
  • Walk the ISA hierarchy (concept-isa.json) from each variable's concept_id up to its NCPI category (ncpi-categories.json).
  • Unclassified variables (no concept_id) go under an "Other / Unclassified" group.

2. Tiered Display by Study Size

  • ≤200 variables: Show the full tree including individual variables (name + description) under each concept.
  • >200 variables: Show the tree down to the concept level only (category → concept with variable counts). Individual variables are not listed.

Study size distribution: 2,721 studies (95%) have ≤200 variables; 143 studies have >200.

3. Data Sources (JSON only, no DuckDB needed)

All data can be computed at build time from these files:

File Purpose
catalog-build/classification/output/llm-concepts-v4/phs*.json Variables with concept_id per study
catalog-build/classification/output/concept-isa.json Concept → parent category mapping
catalog-build/classification/output/ncpi-categories.json Top-level NCPI category names/descriptions
catalog-build/classification/output/concept-vocabulary.json Concept names and descriptions

4. Build-Time Computation

For each study:

  1. Read llm-concepts-v4/phs{study}.json
  2. Group variables by concept_id
  3. Walk ISA hierarchy to resolve each concept to its NCPI category
  4. Emit a tree structure: { category → { concept → [variables] } }
  5. Include variable count per concept (always) and variable details (only if study total ≤200)

Design

  • Add a new "Variables" tab on the study detail page, next to the existing Publications tab.
  • Tree is collapsible by category.
  • Support search/filter within the variable list for studies that show individual variables.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions