cognoma / frontend

Frontend for Project Cognoma
http://cognoma.org/
Other
4 stars 22 forks source link

Creating the mutation frequency heatmap for the query review screen #89

Open dhimmel opened 7 years ago

dhimmel commented 7 years ago

For the query review screen, we'd like to have a heatmap showing the frequency of each mutation for each disease type. You can see what these heatmaps will look like in this notebook.

@bdolly so you can get started implementing this, you will need the following two things:

  1. the vega-lite specification here. You will override the data attribute for the query specific data.
  2. the input data for vega-lite. You can see an example here. This data should must be passed to the vega-lite spec. Ultimately the frontend will compute these mutation frequencies based on the selected mutations and disease types.

This example here corresponds to many genes and disease types. I'd expect most heatmaps to be smaller (have fewer rows & columns).

dhimmel commented 7 years ago

where is this data getting generated from? Is there a core-services endpoint that will deliver that to the front-end?

In the example above, the notebook generated that JSON. However, the goal is to generate this data in the frontend (or if neccessary via the backend). The idea is that the vega-lite specification will stay the same, but the frontend will update the data whenever the user selection changes.

I believe the frontend has all the necessary info to calculate these frequencies. For example:

"data": {
  "values": [
  {
    "disease": "adrenocortical cancer",
    "frequency": 0.01282051282051282,
    "gene_symbol": "AJUBA"
  },

To calculate the above value, the frontend would have to know all the sample_ids with adrenocortical cancer and all the sample_ids with AJUBA mutations. Then frequency equals the number of sample_ids with adrenocortical cancer and AJUBA mutation divided by the number of sample_ids with adrenocortical cancer.

@bdolly what is your opinion on whether this calculation should be done in the front or backend?