Subset AntibodyArray gene graphs; give the data table its samples - #216
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sampleentity — while every existing EDA gene graph is single-entity, so nothing had exercised that path.displayMode:highlight→subsetEdaAntibodyArrayDatasetsemitted 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.EdaCellularLocalizationDatasetsalready emitssubset; 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
antibodyArrayDataTableGeneTableSqljoined only the gene entity, so every row was a bare value with no indication of which sample it came from — 450 anonymous intensities forPF3D7_1441400. It now joinseda.ancestors_<study>_<entity>and reportssample, keeping onlyNORMALIZED_INTENSITY; theSampleandNormalized Intensitycolumns replace the oldVariable/Valuepair.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 constantDatasetvariable collapsed into one. That is data loss rather than tidying, so this usesUNION 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: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, modelUniDB) and verified withwdkQuery -showQueryplus the rendered SQL run against the appDb. Paired with VEuPathDB/web-monorepo#PENDING, which adds the box plot component theplot_typeinEDAGeneGraphs.xlsasks for.🤖 Generated with Claude Code