uclahs-cds / package-BoutrosLab-plotting-general

Functions to Create Publication-Quality Plots
https://uclahs-cds.github.io/package-BoutrosLab-plotting-general
12 stars 4 forks source link

Default colour scheme #152

Open dan-knight opened 1 year ago

dan-knight commented 1 year ago

From discussion with @WuSelina:

@pboutros wants me to add a default color palette to BPG and I would like to ask you what is recommended for this. I have these colors which correspond to the following labels:

baseChange.colors <- c(
   'darksalmon',
   'lightskyblue2',
   'darkseagreen2',
   'thistle2',
   'burlywood1',
   'lemonchiffon1'
   );

legend.baseChange.labels <- c(
   'A>C/T>G',
   'A>G/T>C',
   'A>T/T>A',
   'C>T/G>A',
   'C>G/G>C',
   'C>A/G>T'
   );
dan-knight commented 1 year ago

There's already a default.colours() function, which returns a list of colours. This is nicely generalizable, as it can return an arbitrary number of colours depending on each use-case. For example, you would use baseChange.colours <- default.colours(number.of.colours = 6);

Is this essentially what you were imagining? It's possible that the colour scheme itself could be improved, especially as more colours are requested. For example, there's some code in CAP which does something similar, but can theoretically handle infinite colours by generating each new colour programmatically (all while ensuring proper contrast).

WuSelina commented 1 year ago

@dan-knight There will be six colors for this color palette. I was hoping to create a default palette for base changes included in BPG, like how we have them for chromosomes, gleason.score, tissue, etc.

The colors I have used in the example are matched to the base change colors used in this paper: Figure 2: Coding somatic SNVs are rare in non-indolent, localized tumours.

dan-knight commented 1 year ago

Ah, I see. So default palettes for specific use cases. Are these other ones (chromosomes, gleason, etc.) already in the package somewhere?