Closed tuxette closed 1 year ago
I'm not addressing the issue, but commenting with a specific example as I've bumped into this myself when looking at a small Hi-C map. Starting from the first 4 bins in the example of plotSim
:
load(system.file("extdata", "hic_imr90_40_XX.rda", package = "adjclust"))
sim <- extractRegion(hic_imr90_40_XX, c(1,2), chr="chrX", from=2e6, to=2.8e6)
We get:
> intdata(sim)
4 x 4 sparse Matrix of class "dsCMatrix"
72090 72104 72105 72106
72090 2 . . .
72104 . 520 26 12
72105 . 26 2038 39
72106 . 12 39 1866
In particular the largest similarity (2038) is at (3,3) but plotSim(sim)
places a white cell at (3,3) when log=TRUE
(which is the default for plotSim
). However, everything seems fine when log=FALSE
:
plotSim(sim)
plotSim(sim, log = FALSE)
I don't understand why the log
option should make a difference from the code https://github.com/pneuvial/adjclust/blob/develop/R/plotSim.R#L293-L298:
Related note: forcing the first color of the palette to be "white" (https://github.com/pneuvial/adjclust/blob/develop/R/plotSim.R#L300) means that we silently force the "white" color for large similarity values (because we're also reverting the palette in the above code line). This makes sense for the default palette but typically not for other palettes, e.g. RColorBrewer palettes.
The entire issue is solved by ggPlotSim (still in progress at time of closing of the issue) since commit 9383f3ffa0f9175a0a56c1855a5efae6ab8359b1
See examples in tests of the function that do not look right.