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.
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.
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.)
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 😄
⚠️ Blocked by #1177
Context
Quoting https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/1165#issue-980606286
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.
legend()
. We need the following:figures/palettes/oncoprint_color_palette.tsv
but with the color names cleaned up)broad_histology
panel-specific color palettes for each panel, where thecancer_group
legend is in the same order as the oncoprint panel itself (https://github.com/AlexsLemonade/OpenPBTA-analysis/issues/1174#issuecomment-915351111) and only includescancer_group
that actually get displayedmultipanelfigure
. I think doing steps 1 AND 2 withinoncoprint-landscape
with it's own notebook or script might be the best way to go about this.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.)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 😄