Problem
pgx$organism is stored un-normalized across the fleet: existing datasets carry "Human", "human", "Homo sapiens", "Mouse", "mouse", "Mus musculus", etc. as distinct strings rather than a canonical value.
This breaks any exact-match check against organism, most concretely:
# R/pgx-compute.R:1170
species_go <- !(pgx$organism %in% c("Human", "Mouse", "Rat"))
A dataset labeled "Homo sapiens" (rather than "Human") takes the TRUE branch and pays for a full AnnotationHub GO download it shouldn't need. The same fragility likely affects other pgx$organism %in% c(...) checks throughout the codebase (e.g. pgx-init.R, correlation_table_corr.R, compare_server.R in omicsplayground).
Origin
Flagged by @phisanti in review of bigomics/omicsplayground#1891 (companion PR to #520), while live-testing dataset loads against the real fleet:
Source organism: yes. pgx$organism (pgx-compute.R:422), on all 52, mirrored in datasets-info.csv. But it's stored un-normalised — the fleet has "Human", "human", "Homo sapiens", "Mouse", "mouse", "Mus musculus" as distinct strings. That's exactly what breaks species_go <- !(pgx$organism %in% c("Human","Mouse","Rat")) at pgx-compute.R:1170: "Homo sapiens" takes the TRUE branch and pays a full AnnotationHub GO download.
Suggested fix
- Add a canonicalization step (e.g. in
pgx.initialize() or pgx.getOrganism()) that maps known aliases/scientific names to the canonical display form used throughout the codebase ("Human", "Mouse", "Rat", ...).
- Audit
pgx$organism %in% c(...) call sites across both playbase and omicsplayground for the same fragility.
- Consider whether existing
.pgx files / datasets-info.csv need a one-time backfill, or whether normalizing on load is sufficient.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NdKjbG6mq44txcD2jbmgid
Problem
pgx$organismis stored un-normalized across the fleet: existing datasets carry"Human","human","Homo sapiens","Mouse","mouse","Mus musculus", etc. as distinct strings rather than a canonical value.This breaks any exact-match check against organism, most concretely:
A dataset labeled
"Homo sapiens"(rather than"Human") takes theTRUEbranch and pays for a full AnnotationHub GO download it shouldn't need. The same fragility likely affects otherpgx$organism %in% c(...)checks throughout the codebase (e.g.pgx-init.R,correlation_table_corr.R,compare_server.Rin omicsplayground).Origin
Flagged by @phisanti in review of bigomics/omicsplayground#1891 (companion PR to #520), while live-testing dataset loads against the real fleet:
Suggested fix
pgx.initialize()orpgx.getOrganism()) that maps known aliases/scientific names to the canonical display form used throughout the codebase ("Human","Mouse","Rat", ...).pgx$organism %in% c(...)call sites across both playbase and omicsplayground for the same fragility..pgxfiles /datasets-info.csvneed a one-time backfill, or whether normalizing on load is sufficient.🤖 Generated with Claude Code
https://claude.ai/code/session_01NdKjbG6mq44txcD2jbmgid