ebi-gene-expression-group / atlas-web-single-cell

Single Cell Expression Atlas web application
Apache License 2.0
5 stars 5 forks source link

Make experiment unit adaptable not hard-coded in marker gene heatmap #447

Closed lingyun1010 closed 2 weeks ago

lingyun1010 commented 1 month ago

In Single Cell web app the units that appears in the Marker Genes tab of the Experiment page below the title: Cluster marker genes looks like they are hardcoded. They are displaying: Median expression (CPM)

We should get the units from our Postgres DB. We are storing it in the experiment table's expression_unit field.

ke4 commented 1 month ago

It is hardcoded in 5 different places.

  1. scxa-marker-gene-heatmap component: In the MarkerGeneHeatmap.js we need to change this lines to get the units from an input variable / property.

in line, 245 in the current version of the file:

    legend: {
      title: {
        text: `Median expression (CPM)`
      },
      align: `center`,
      verticalAlign: `top`,
      layout: `horizontal`,
      symbolWidth: 480,
      enabled: data.length !== 0
    },
  1. scxa-marker-gene-heatmap component: in heatmapOptionsProvider.js, line 16 in the current version of the file:

    <b>Expression:</b> ${+this.point.value.toFixed(3)} CPM
  2. scxa-marker-gene-heatmap component: in heatmapOptionsProvider.js, line 46 in the current version of the file:

    <b>Expression:</b> ${+this.point.value.toFixed(3)} CPM
  3. scxa-marker-gene-heatmap component: in heatmapOptionsProvider.js, line 67 in the current version of the file:

    <b>Median expression:</b> ${+this.point.value.toFixed(3)} CPM
  4. scxa-tsne-plot component: in GeneExpressionTSnePlot.js, line 167 in the current version of the file:

    {
      title: {
        text: "Expression level (CPM)"
      },
      floating: false,
      align: "center",
      symbolHeight: 5,
      symbolWidth: 450,
      enabled: true
    }
ke4 commented 1 month ago

And there is a 6th hardcoded, but that is coming from the backend: CellPlotJsonSerializer.java, line 91:

        var unit = "CPM"; // Get units from experiment, or from request parameter if more than one is available

This should be changed and getting that value from the DB. This is a must have fix for the current release.

ke4 commented 1 month ago

PR for the 6th case: [Chore] Get expression unit from the DB for Cell plots tab / Gene Expression part #449