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

Adding high-level metadata summary to search results (SCP-5845) #2155

Closed bistline closed 1 day ago

bistline commented 1 week ago

BACKGROUND

A recent Zendesk request was submitted by a user looking for ways to export or preview high-level information about studies in search results. Currently, the only way to filter studies is through the search interface, but only on the filter values selected. There is no way to glean additional high-level information (e.g. species, disease, etc.) about search results without loading each study individually and inspected the contents of said annotations. The requesting user referenced the Genomic Data Commons cohort builder as an example.

CHANGES

This update now adds a table to all search results (both SCP- and HCA-based) that contains the entries from 5 metadata convention based annotations: disease__ontology_label, organ__ontology_label, species__ontology_label, library_preparation_protocol__ontology_label, and sex. This data is now present in the search API response for any request. Each study will show up to 2 values per annotation, with the rest hidden behind a {n} more... label with a tooltip containing the rest of the labels. Any studies lacking the information for a given column will display unspecified. These result tables are shown both in study- and gene-based searches.

Examples of results: Screenshot 2024-10-21 at 3 25 12 PM

Screenshot 2024-10-21 at 3 24 43 PM

more... tooltip Screenshot 2024-10-21 at 3 27 02 PM

Example in global gene search: Screenshot 2024-10-21 at 3 25 59 PM

This can also be viewed as potential preparatory work for a "cohort-builder" type interface, though this would only be for study-level data. Cell-level cohorts would likely have more power and utility, but SCP lacks a true cell-level search interface, though it would be possible for metadata convention compliant studies.

MANUAL TESTING

  1. Boot as normal and confirm default results contain metadata information
  2. Run any search (facet- or text-based) and confirm that normal functionality is not affected
  3. Run a global gene search and confirm the metadata table renders above the violin plot as well
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 94.54545% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.07%. Comparing base (d2f033c) to head (be83be6). Report is 24 commits behind head on development.

Files with missing lines Patch % Lines
...pt/components/search/results/StudySearchResult.jsx 0.00% 2 Missing :warning:
.../components/search/results/ResultMetadataTable.jsx 96.77% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155/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/2155?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) ```diff @@ Coverage Diff @@ ## development #2155 +/- ## =============================================== + Coverage 69.97% 70.07% +0.10% =============================================== Files 331 332 +1 Lines 27990 28066 +76 Branches 2452 2457 +5 =============================================== + Hits 19585 19668 +83 + Misses 8259 8252 -7 Partials 146 146 ``` | [Files with missing lines](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) | Coverage Δ | | |---|---|---| | [...controllers/api/v1/study\_search\_results\_objects.rb](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Fcontrollers%2Fapi%2Fv1%2Fstudy_search_results_objects.rb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2NvbnRyb2xsZXJzL2FwaS92MS9zdHVkeV9zZWFyY2hfcmVzdWx0c19vYmplY3RzLnJi) | `90.00% <100.00%> (+1.53%)` | :arrow_up: | | [.../javascript/components/explore/FacetComponents.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fexplore%2FFacetComponents.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy9leHBsb3JlL0ZhY2V0Q29tcG9uZW50cy5qc3g=) | `89.89% <100.00%> (ø)` | | | [...t/components/search/genes/StudyGeneExpressions.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fsearch%2Fgenes%2FStudyGeneExpressions.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy9zZWFyY2gvZ2VuZXMvU3R1ZHlHZW5lRXhwcmVzc2lvbnMuanN4) | `59.52% <ø> (ø)` | | | [...ascript/components/search/results/StudyResults.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fsearch%2Fresults%2FStudyResults.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy9zZWFyY2gvcmVzdWx0cy9TdHVkeVJlc3VsdHMuanN4) | `100.00% <ø> (ø)` | | | [app/lib/azul\_search\_service.rb](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Flib%2Fazul_search_service.rb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2xpYi9henVsX3NlYXJjaF9zZXJ2aWNlLnJi) | `95.77% <100.00%> (+0.35%)` | :arrow_up: | | [.../components/search/results/ResultMetadataTable.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fsearch%2Fresults%2FResultMetadataTable.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy9zZWFyY2gvcmVzdWx0cy9SZXN1bHRNZXRhZGF0YVRhYmxlLmpzeA==) | `96.77% <96.77%> (ø)` | | | [...pt/components/search/results/StudySearchResult.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fsearch%2Fresults%2FStudySearchResult.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy9zZWFyY2gvcmVzdWx0cy9TdHVkeVNlYXJjaFJlc3VsdC5qc3g=) | `88.54% <0.00%> (-0.94%)` | :arrow_down: | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2155/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute)