Re: [R] heatmap ploting

2021-11-05 Thread Jim Lemon
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  wrote:
>
> Dear Community,
>
> I have an example heatmap plot in this link
> 
> 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@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.

__
R-help@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.


[R] heatmap ploting

2021-11-05 Thread Stephen HonKit Wong
Dear Community,

I have an example heatmap plot in this link

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@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.