dtm2451 / dittoSeq

Color blindness friendly visualization of single-cell and bulk RNA-sequencing data
MIT License
182 stars 18 forks source link

dittoHeatmap with pale heat map colors #144

Open kmakat opened 4 months ago

kmakat commented 4 months ago

Hi,

Thanks for that great package.

Just started to explore it. When I use dittoHeatmap on Seurat objects it runs without errors and produces the expected output in terms of annotation etc. but the heat map colors are pale, like there is a some layer on top of it. Changing the backend to ComplexHeatmap does not help.

Screenshot 2024-03-03 at 7 06 26 PM

Extracting the data and using ComplexHeatmap directly, works.

Screenshot 2024-03-03 at 7 15 37 PM

Maybe this a macOS/Quartz related issue?

Thanks, Kemal

M2 Mac
R Under development (unstable) (2023-10-30 r85440)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.3.1
dittoSeq_1.15.3 
dtm2451 commented 4 months ago

Hmmm very odd and I'm tempted to say yes, it might be a macOS/Quartz related issue but only because I don't have another explanation.

I think of dittoHeatmap() as "just" a wrapper that helps build pheatmap() inputs for the user, then shuttles them over. There's nothing internal to dittoHeatmap() that adjusts your given heatmap.colors (the pheatmap() color equivalent) or adds a layer to cause this paleness. Thus, the issue must come later on.

I have noticed in the past, when mucking with dittoHeatmap outputs in Illustrator, that there was a white background and the heatmap elements weren't completely opaque. But it is very odd to me that the difference is so profound for you as it has always been small enough for me that I hadn't even noticed until I moved to Illustrator!

After poking at the ComplexHeatmap::pheatmap() code, as you say you've seen the same with complex = TRUE, I'm still not sure at all where the effect might come from. There's nothing in that function itself which seems to give an opacity adjustment, unless there's something later on that derives from this line... If I use ComplexHeatmap::draw(<ditto_out>, background="black") the heatmap itself still looks the same as when background="white" for me. Is that the same for you on your M2 Mac?

j-andrews7 commented 1 month ago

This is due to the scales being much larger in the first plot. Providing the breaks directly will fix it.