Closed bistline closed 3 months ago
Attention: Patch coverage is 71.01449%
with 20 lines
in your changes missing coverage. Please review.
Project coverage is 69.63%. Comparing base (
e42082e
) to head (a02f384
). Report is 3 commits behind head on development.
The build failure seems to be a true positive. I'll be available after demo if you'd like to pair!
Total elapsed time: 25 minutes, 54 seconds ### FAILURES and ERRORS ### *** Yarn test failures *** FAIL test/js/explore/differential-expression-panel.test.js (14.966 s) ✕ renders DE genes table (379 ms) ✕ renders pairwise group picker (61 ms) FAIL test/js/explore/differential-expression-panel.test.js (14.966 s) *** Rails test failures *** Exiting with code: 1
Yeah, on it - pretty sure I know what I broke in the test.
Build failure now is unrelated, upstream Terra issue.
I just discovered a bug with this... everything works fine on initial load where you add spatial plots iteratively, but once they're all loaded it breaks on annotation switch or page reload. This is because the spatial plots might render before the main plot, and the refColorMap
changes after they've rendered, leading to color mismatches across or even within a plot (e.g. spatial plot has different colors for trace and legend).
@eweitz @jlchang this is ready for review now, I think I've get the state issue fixed.
I created SCP405 on staging to reproduce SCP1375 from production, for convenient reference.
BACKGROUND & CHANGES
This update fixes issues discovered with scatter plot legends when viewing multiple plots in the spatial UX. Whenever a user selects a new spatial plot, every legend shown then updates the counts to use data from the newest spatial plot. Additionally, if certain labels are missing from the newest plot, those legend entries are still shown but with a count of 0.
The cause was from a shared
useState
reference inExploreDisplayTabs
for setting label counts (this was done so it could be shared with various components in the differential expression UX). Now, counts are managed at theScatterPlot
level instead ofExploreDisplayTabs
. Additionally, color assignments are now tracked using the main, non-spatial plot as the control. Any additional spatial plots will use that color map to ensure that labels keep the same color assignment across all plots.Note: you may see a brief flicker as colors are reassigned, this has to do with waiting for the main plot to finish rendering.
MANUAL TESTING
The easiest way to test this PR is to ingest data from SCP1375 (this is the study where the above bugs were found). Only 4 files are needed for testing:
top_level_umap.csv
andtop_level_cell_type
as the annotationspatial_8months-control-replicate_1.csv
Astro
is 6789 fortop_level_umap.csv
and 919 forspatial_8months-control-replicate_1.csv
spatial_8months-control-replicate_1.csv
does not have the groupLHb
, and the color forMicro
and the remaining labels match in both plotsspatial_13months-disease-replicate_2.csv
from the spatial groups menuAstro
is 927 and that it has theLHb
group with a count of 65 and the correct colorHide all
in the legend for the main plot then scroll to the bottom and select the last entry, this is a quick way to ensure that assignments have stayed consistent across all plots.