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

Allow providing external link for AnnData clusters (SCP-5816) #2142

Closed bistline closed 3 weeks ago

bistline commented 4 weeks ago

BACKGROUND & CHANGES

This fixes an issue with the AnnData upload UX where the external link feature for clustering data does not persist when saving the form. This was due to how the data is validated and saved inside the AnnDataFileInfo object and the parameters not being allowed or handled correctly. Now, these parameters are allowed and the data is saved correctly. Additionally, this cleans up some tests where names of clustering in AnnData files were accidentally prepending X_.

This does bring up a frequent issue when adding attributes to models - the need to add them to the "strong parameters" block in associated controllers (e.g. params.require(model_name).permit). I created SCP-5818 to track this. It's not critical work, but would hopefully alleviate this issue.

MANUAL TESTING

You will need to turn off caching for this to work properly, or start DelayedJob.

  1. Boot as normal and sign in
  2. Load the upload wizard for any AnnData-based study
  3. Go to the clustering tab and add an external link for one of the clusters
  4. Open the explore tab for the above study/cluster and confirm the link is present above the scatter plot legend
codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.63%. Comparing base (0eaa7e3) to head (4a671fb). Report is 9 commits behind head on development.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2142/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/2142?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) ```diff @@ Coverage Diff @@ ## development #2142 +/- ## =============================================== - Coverage 69.64% 69.63% -0.01% =============================================== Files 331 331 Lines 27936 27942 +6 Branches 2438 2438 =============================================== + Hits 19456 19458 +2 - Misses 8327 8331 +4 Partials 153 153 ``` | [Files with missing lines](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2142?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) | Coverage Δ | | |---|---|---| | [app/controllers/api/v1/study\_files\_controller.rb](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2142?src=pr&el=tree&filepath=app%2Fcontrollers%2Fapi%2Fv1%2Fstudy_files_controller.rb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2NvbnRyb2xsZXJzL2FwaS92MS9zdHVkeV9maWxlc19jb250cm9sbGVyLnJi) | `83.95% <ø> (ø)` | | | [...ollers/api/v1/visualization/clusters\_controller.rb](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2142?src=pr&el=tree&filepath=app%2Fcontrollers%2Fapi%2Fv1%2Fvisualization%2Fclusters_controller.rb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2NvbnRyb2xsZXJzL2FwaS92MS92aXN1YWxpemF0aW9uL2NsdXN0ZXJzX2NvbnRyb2xsZXIucmI=) | `86.74% <100.00%> (+0.41%)` | :arrow_up: | | [app/models/ann\_data\_file\_info.rb](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2142?src=pr&el=tree&filepath=app%2Fmodels%2Fann_data_file_info.rb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL21vZGVscy9hbm5fZGF0YV9maWxlX2luZm8ucmI=) | `97.56% <100.00%> (+0.01%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2142/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute)