[R] heatmap ploting

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Fri Nov 5 09:49:44 CET 2021


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 using gmail.com> wrote:
>
> 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
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list