Repository navigation
fix(ai-report): build DE tables for PGX files without group means - #566
Conversation
Older PGX files keep only meta.fx/meta.p/meta.q/fc/p/q per contrast in gx.meta, with no avg.0/avg.1. .de_gene_table() passed the resulting zero-length vectors to data.frame(), which failed with "arguments imply differing number of rows: 50, 0" and stopped every AI Studio report on such a dataset before any model call. The avg_first/avg_second columns are now left out when the group means are absent; newer PGX files render the same table as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Merging with the Checked outside CI instead:
|
Problem
Every AI Studio report on an older PGX file fails before any model call. The public
geiger2016-arginine(a 2020 LC/MS proteomics dataset) is one example:These files keep only
meta.fx meta.p meta.q fc p qper contrast ingx.meta, with noavg.0/avg.1. Somx$avg.0[ord]has length 0. The annotation column is not the cause:.de_annotate_genes()already falls back togene_title, which older and current files both carry.Fix
.de_gene_table()leaves outavg_first/avg_secondwhen the group means are absent. Newer PGX files get the same table as before, with the same column order.I checked the rest of the report family on the same dataset (
de_build_methods, pathways, drugs for both stored databases,.ai_report_get_label,combined_build_report_data). All pass, so nothing else changes. That dataset has nowgcnaormofaslot, so those were not checked against it.Tests
test-ai-report.Rcase that builds the oldgx.metashape synthetically. It errors onfantaand passes with the fix. It also pins the full column order when the means are present.test-ai-*files in a prod compute-light image: 11/11 pass.fanta(createPGX, PathBank network calls, importance snapshots) come from the image being older thanfanta.compute_ai_studio_report_context():geiger2016-arginine: DE, pathways, two drug databases and the combined phase all build (they failed before);example-datarecompute: unchanged, still hasavg_first/avg_second, and wgcna also builds.The monorepo's
playbase-ai-studiosource bundle will pin this commit in a separate PR.🤖 Generated with Claude Code