AlexsLemonade / OpenPBTA-analysis

The analysis repository for the Open Pediatric Brain Tumor Atlas Project
Other
99 stars 66 forks source link

Create panel of standalone legends for the oncoprint plots #1178

Closed jaclyn-taroni closed 2 years ago

jaclyn-taroni commented 3 years ago

⚠️ Blocked by #1177

Context

Quoting https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/1165#issue-980606286

  • Create a unified legend and add to the right side of the plots (I feel like this is a ticket in itself and maybe @kgaonkar6 can tackle - we would maybe have to make color boxes with labels and make them another figure, then put it into this panel - thoughts? (Since there are a lot of samples which are not displayed, some cancer groups in the legend do not have these samples in the plots, so I think we would want to only list those which have samples). It would also be nice to convert these so there are no underscores and the whole words are displayed (eg - In_Frame_Ins --> In-frame insertion) - honestly, I just made these in excel before (ick) and created a piece of a figure and put it in the final figure, so if this is a huge coding challenge, it can be done like that, as tedious as it is.

Next steps

There are at least four steps to getting a unified legend into a final oncoprint figure that I am aware of, which I will detail below.

  1. Create a series of standalone legends using legend(). We need the following:
    • The oncoprint palette legend (using figures/palettes/oncoprint_color_palette.tsv but with the color names cleaned up)
    • broad_histology panel-specific color palettes for each panel, where the cancer_group legend is in the same order as the oncoprint panel itself (https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/1174#issuecomment-915351111) and only includes cancer_group that actually get displayed
      • A. Low-grade astrocytic tumor
      • B. Embryonal tumor
      • C. Diffuse astrocytic and oligodendroglial tumor
      • D. Other CNS
  2. Compile the series of legends into a single panel with something like multipanelfigure. I think doing steps 1 AND 2 within oncoprint-landscape with it's own notebook or script might be the best way to go about this.
  3. Alter analyses/oncoprint-landscape/02-plot-oncoprint.R such that individual oncoprints don't get legends. (Maybe, this will depend on what decisions are made for #1177.)
  4. Update figures/scripts/oncoprint-landscape.R to include the legends panel from step 2.

I am planning on implementing this myself and if not, some of these steps might need their own more detailed issues.

Sketch putting it all together

I'll just note that this is not aligned properly, but you get the idea and I wasn't going to redraw it 😄

IMG_2160

jaclyn-taroni commented 2 years ago

Closed via #1200