esqLABS / esqlabsR

Utility functions for modelling and simulation workflows within esqLABS organization
https://esqlabs.github.io/esqlabsR/
GNU General Public License v2.0
18 stars 2 forks source link

`sensitivityTimeProfiles`: better color selection #162

Closed PavelBal closed 2 years ago

PavelBal commented 2 years ago

With the current color gradient, it is not clear in which "direction" the colors move as the edges of the gradient look like they are "connected".

image

PavelBal commented 2 years ago

So select more distinct colors to move from to.

IndrajeetPatil commented 2 years ago

Here are all available palettes. Let me know which one you prefer, and I will make that the default:

library(esqlabsR)

simPath <- system.file("extdata", "Aciclovir.pkml", package = "esqlabsR")
simulation <- loadSimulation(simPath)
outputPaths <- "Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)"
parameterPaths <- c(
  "Aciclovir|Lipophilicity",
  "Applications|IV 250mg 10min|Application_1|ProtocolSchemaItem|Dose",
  "Neighborhoods|Kidney_pls_Kidney_ur|Aciclovir|Glomerular Filtration-GFR|GFR fraction"
)

set.seed(123)
results <- sensitivityCalculation(
  simulation = simulation,
  outputPaths = outputPaths,
  parameterPaths = parameterPaths
)

sensitivityTimeProfiles(results, palette = "Pastel 1")

sensitivityTimeProfiles(results, palette = "Dark 2")

sensitivityTimeProfiles(results, palette = "Dark 3")

sensitivityTimeProfiles(results, palette = "Set 2")

sensitivityTimeProfiles(results, palette = "Set 3")

sensitivityTimeProfiles(results, palette = "Warm")

sensitivityTimeProfiles(results, palette = "Cold")

sensitivityTimeProfiles(results, palette = "Harmonic")

sensitivityTimeProfiles(results, palette = "Dynamic")

Created on 2022-02-21 by the reprex package (v2.0.1.9000)

IndrajeetPatil commented 2 years ago

Any thoughts on this?

PavelBal commented 2 years ago

Let's try with esqLABS_color https://github.com/esqLABS/esqlabsR/blob/3b13524235ccfa452552cefada4247f5ca452f26/R/utilities-figures.R#L18

Can you make it work?

PavelBal commented 2 years ago

Please also try the esqlabs-palette and show an example.

IndrajeetPatil commented 2 years ago

For now, I am choosing cold palette (see example above) as the default palette.

Please also try the esqlabs-palette and show an example.

This doesn't work.

The function generates discrete colours.

library(esqlabsR)
esqLABS_colors(10)
#>  [1] "#0D8DDA" "#142DDD" "#5F13E1" "#C911E4" "#E81098" "#EB1733" "#BF6A24"
#>  [8] "#C7CE20" "#65DC1C" "#26B042"

Created on 2022-04-08 by the reprex package (v2.0.1.9000)

But we need continuous colours:

colorspace::scale_color_continuous_qualitative(
  palette = "Cold",
  breaks = c(1, 10)
)
#> <ScaleContinuous>
#>  Range:  
#>  Limits:    0 --    1

This is because our scale is continuous:

image