broadinstitute / single_cell_portal_core

Rails/Docker application for the Broad Institute's single cell RNA-seq data portal
https://singlecell.broadinstitute.org
BSD 3-Clause "New" or "Revised" License
62 stars 26 forks source link

Prevent rendering spatial plots with missing cluster-based annotations (SCP-5671) #2072

Closed bistline closed 3 months ago

bistline commented 3 months ago

BACKGROUND & CHANGES

This fixes an issue where spatial plots will break when trying to load a cluster-based annotation that is available for the main scatter plot, but missing for the spatial plot(s). Now, instead of an error, a warning is shown instead telling the user that the requested annotation is not available for the given spatial plot.

This also fixes an unrelated bug where the "Use bucket path" feature was not able to correctly validate/browse metadata files.

Quick demo:

https://github.com/broadinstitute/single_cell_portal_core/assets/729968/bdaee530-f377-4da6-8e0a-10da579f360c

MANUAL TESTING

The easiest way to test this is with two scatter plots from SCP1756 (you can also add the metadata but it is not strictly necessary):

  1. Create a new study with the above scatter plots, ensuring that umap_1month-org1-Slide-seq.txt is uploaded as spatial
  2. Once ingested, go to the Explore tab for the new study and load the umap_1month-org1-Slide-seq.txt as an extra spatial scatter plot
  3. Select the CellType cluster-based annotation and confirm that it loads correctly
  4. Select the Cluster annotation and confirm that you see the warning that the spatial plot does not have the requested annotation
codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 64.58333% with 17 lines in your changes missing coverage. Please review.

Project coverage is 69.63%. Comparing base (4694304) to head (26d2414).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2072/graphs/tree.svg?width=650&height=150&src=pr&token=HMWE5BO2a4&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute)](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2072?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) ```diff @@ Coverage Diff @@ ## development #2072 +/- ## =============================================== - Coverage 69.64% 69.63% -0.02% =============================================== Files 323 323 Lines 27153 27165 +12 Branches 2229 2235 +6 =============================================== + Hits 18912 18916 +4 - Misses 8116 8124 +8 Partials 125 125 ``` | [Files](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2072?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) | Coverage Δ | | |---|---|---| | [app/javascript/components/upload/MetadataStep.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2072?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fupload%2FMetadataStep.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy91cGxvYWQvTWV0YWRhdGFTdGVwLmpzeA==) | `77.27% <100.00%> (+1.08%)` | :arrow_up: | | [...avascript/components/visualization/ScatterPlot.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2072?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fvisualization%2FScatterPlot.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy92aXN1YWxpemF0aW9uL1NjYXR0ZXJQbG90LmpzeA==) | `64.87% <63.82%> (+0.19%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2072/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute)