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

Sort DE table by Scanpy score by default (SCP-5695) #2077

Closed eweitz closed 3 months ago

eweitz commented 3 months ago

This refines row order in the differential expression table, which better aligns our UI with computed and published results.

Overview

Previously, the DE table was sorted by adjusted p-value and then log2(fold change). This was suggested in an SCP demo, and ranking by significance then size is a helpfully transparent way to sort DE results. However, when SCP computes DE, the underlying Scanpy results are sorted by a "score" metric.

Scanpy score is not shown in the DE table UI, but if users tried to reproduce SCP results, they might be confused by the different sort order in their Scanpy results and SCP's DE UI table. Perhaps more valuably, sorting by Scanpy also makes SCP's DE UI table more consistent with published results, which often focus on top DE genes as sorted by Scanpy score.

Now, the SCP UI table uses Scanpy score to sort rows of genes in the DE table. This simplifies the code and user interpretation, and likely better captures Scanpy's methodological nuance in surfacing the most relevant genes.

Video

Here's how the new and old DE table sorting looks, and how it compares with results in a corresponding publication.

https://github.com/broadinstitute/single_cell_portal_core/assets/1334561/b2aa2091-0885-421c-92f0-f297b1e6488d

Test

Automated tests were updated to account for these changes. If you'd like to manually test:

  1. Go to "Human milk" study
  2. Click "Differential expression"
  3. Select "LC1"
  4. Confirm first genes are CLDN4, JUN, and KLF6

This satisfies SCP-5695.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.62%. Comparing base (98f68b1) to head (7d2d88a).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2077/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/2077?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) ```diff @@ Coverage Diff @@ ## development #2077 +/- ## =============================================== - Coverage 69.62% 69.62% -0.01% =============================================== Files 323 323 Lines 27165 27164 -1 Branches 2235 2235 =============================================== - Hits 18913 18912 -1 Misses 8127 8127 Partials 125 125 ``` | [Files](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2077?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute) | Coverage Δ | | |---|---|---| | [...components/explore/DifferentialExpressionPanel.jsx](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2077?src=pr&el=tree&filepath=app%2Fjavascript%2Fcomponents%2Fexplore%2FDifferentialExpressionPanel.jsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute#diff-YXBwL2phdmFzY3JpcHQvY29tcG9uZW50cy9leHBsb3JlL0RpZmZlcmVudGlhbEV4cHJlc3Npb25QYW5lbC5qc3g=) | `68.53% <50.00%> (-0.12%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/broadinstitute/single_cell_portal_core/pull/2077/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=broadinstitute)