Skip to content

heatmap ploting

2 messages · Stephen HonKit Wong, Jim Lemon

#
Dear Community,

I have an example heatmap plot in this link
<https://drive.google.com/file/d/15ePaR0gC2IKXm2gkeGylZ4vM_MEsWyW0/view?usp=sharing>
which was generated by java I believe, I want to make a similar plot in R.
Any clues on how to do it? Thanks.

The column is a gene, and the rows are different cancer types with
different numbers of patients. The heatmap value represents the expression
value, such as FPKM, which can range from 0 to over several hundreds.


Much thanks!

Steve
#
Hi Steve,
That plot looks to me as though a value-to-color transformation is
performed on the logarithm of gene expression. The scale bar can be
roughly reproduced like this:

library(plotrix)
plot(0,xlim=c(0,3))
gradient.rect(0,-0.1,3,0.1,
 col=color.scale(seq(0,3,0.1),
 c(0.7,1,1,1,0.7,0.2),
 c(0.7,1,0,0,0,0),
 c(1,0,0,0.1,0.7,0.2)))
text(0:3,rep(0.2,3),c(0,10,100,1000))

The horizontal lengths of the stacked bars of the plot can then be
adjusted to the number of subjects in a given bin of log gene
expressions. A tricky plot, but it can be done in R.

Jim
On Fri, Nov 5, 2021 at 6:08 PM Stephen HonKit Wong <stephen66 at gmail.com> wrote: