Skip to content

Subset AntibodyArray gene graphs; give the data table its samples - #216

Merged
jbrestel merged 1 commit into
masterfrom
antibody-array-eda-data-table
Aug 13, 2026
Merged

Subset AntibodyArray gene graphs; give the data table its samples#216
jbrestel merged 1 commit into
masterfrom
antibody-array-eda-data-table

Conversation

@jbrestel

Copy link
Copy Markdown
Member

Follow-up to #214. Both fixes come from the same cause: the AntibodyArray EDA studies span two entities — the measurement sits on the gene entity, its identity and covariates on the parent sample entity — while every existing EDA gene graph is single-entity, so nothing had exercised that path.

displayMode: highlightsubset

EdaAntibodyArrayDatasets emitted the literal 'highlight'. A box plot has no per-point identity to highlight, so the plot was drawn from every gene's values rather than the gene whose record page it is. EdaCellularLocalizationDatasets already emits subset; this uses the same value.

Verified on PF3D7_1441400 (Loffler): the gene's 33 measurements span 8.60–12.63, while all 48,543 measurements in the study span 0.88–15.62. The plot now draws the former.

Data table: report the sample, and stop dropping rows

antibodyArrayDataTableGeneTableSql joined only the gene entity, so every row was a bare value with no indication of which sample it came from — 450 anonymous intensities for PF3D7_1441400. It now joins eda.ancestors_<study>_<entity> and reports sample, keeping only NORMALIZED_INTENSITY; the Sample and Normalized Intensity columns replace the old Variable/Value pair.

The template also used UNION, which deduplicates identical tuples. Two samples recording the same intensity for one gene collapsed into a single row, and all 33 rows of the constant Dataset variable collapsed into one. That is data loss rather than tidying, so this uses UNION ALL — which restores the 4 measurements it had been dropping for this gene. The empty seed row remains harmless, filtered out by the join on gene id.

After the change, for PF3D7_1441400:

dataset rows distinct samples min max
Crompton_Mali 421 421 4.1455 6.6524
Loffler_Natural_Infection 33 33 8.6037 12.6327

Rows equal distinct samples in both, and the Loffler range matches what the box plot draws — table and plot demonstrably read the same measurements.

Testing

Built on a dev instance (jbrestel.eupathdb.org, model UniDB) and verified with wdkQuery -showQuery plus the rendered SQL run against the appDb. Paired with VEuPathDB/web-monorepo#PENDING, which adds the box plot component the plot_type in EDAGeneGraphs.xls asks for.

🤖 Generated with Claude Code

Two fixes to the AntibodyArray EDA gene graphs, both from the same cause:
these studies span two entities -- the measurement lives on the gene entity,
its identity and covariates on the parent sample entity -- while every
existing EDA gene graph is single-entity.

displayMode was the literal 'highlight'. A box plot has no per-point
identity to highlight, so the plot showed every gene's values. Use 'subset',
as EdaCellularLocalizationDatasets already does, so the plot shows the gene
whose record page it is.

The data table joined nothing but the gene entity, so its rows were bare
values with no sample: 450 anonymous intensities for PF3D7_1441400. Join
eda.ancestors_<study>_<entity> and report the sample, keeping only
NORMALIZED_INTENSITY. The table now returns one row per sample per dataset
(33 for Loffler, 421 for Crompton), matching the range the box plot draws.

The template also used UNION, which deduplicated identical tuples: two
samples recording the same intensity for one gene collapsed into a single
row, as did all 33 rows of the constant 'Dataset' variable. That is data
loss, not tidying -- UNION ALL restores the 4 measurements it was dropping
for this gene. The empty seed row stays harmless, filtered by the join on
gene id.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jbrestel
jbrestel requested a review from bobular August 12, 2026 18:00
@jbrestel
jbrestel merged commit 98f4202 into master Aug 13, 2026
@jbrestel
jbrestel deleted the antibody-array-eda-data-table branch August 13, 2026 19:04
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