Question: Pheatmap question, how to draw a heatmap with pheatmap when you have 200 DEG to show on the heatmap?
0
gravatar for soheilazareie
4 weeks ago by
soheilazareie10 wrote:

I have 200 differentially expressed genes in my RNAseq dataset and I want to have them all on my heatmap, however, because they are a lot (200), I am not able to see them on heatmap clearly, how I can figure out the size of a heatmap which covers 200 or more genes on one heatmap, how big it should be sized?

Thanks,

rna-seq • 160 views
ADD COMMENTlink modified 4 weeks ago by Kevin Blighe25k • written 4 weeks ago by soheilazareie10

May be you can use discrete colors instead of continuous colors and breaks @OP

ADD REPLYlink modified 4 weeks ago • written 4 weeks ago by cpad01128.3k
0
gravatar for Kevin Blighe
4 weeks ago by
Kevin Blighe25k
USA / Europe / Brazil
Kevin Blighe25k wrote:

You can either modify the cex parameter, or, preferably, modify the dimensions of your output figure, or use a combination of these:

Create random data of dimensions

data <- replicate(25, rnorm(200))
rownames(data) <- paste("Gene", c(1:nrow(data)))
colnames(data) <- paste("Sample", c(1:ncol(data)))

dim(data)
[1] 200  25

Modify cex and output dimensions

pdf("pheatmap.pdf", width=5, height=12)
  out <- pheatmap(data, 
      show_rownames=T,
      cluster_cols=T,
      cluster_rows=T,
      scale="row",
      clustering_distance_rows="euclidean",
      clustering_distance_cols="euclidean",
      clustering_method="complete",
      border_color=FALSE,
      cex=0.7)
dev.off()

top

-------------------------------------

bottom

Just be aware that, with that many genes, it will always be a struggle to get it exactly as you'd want it, e.g., for a publication.

Kevin

ADD COMMENTlink written 4 weeks ago by Kevin Blighe25k

Hi Kevin, Thanks so much for your reply. But I am a bit confused when we create a random data of dimensions,(data <- replicate(25, rnorm(200)) rownames(data) <- paste("Gene", c(1:nrow(data))) colnames(data) <- paste("Sample", c(1:ncol(data)))

dim(data)), in this code, where should I include my own data that I am supposed to make a heat map? also, is this code* separate or should be used after the above one, pdf("pheatmap.pdf", width=5, height=12) *out <- pheatmap(data, show_rownames=T, cluster_cols=T, cluster_rows=T, scale="row", clustering_distance_rows="euclidean", clustering_distance_cols="euclidean", clustering_method="complete", border_color=FALSE, cex=0.7) dev.off(),

another question, I have been trying to use your code but I dont know where my pdf is going to be saved in, and when I run this code with my own data, the only thing I get is , "pdf 5 " Thanks again, Soheila

ADD REPLYlink modified 4 weeks ago • written 4 weeks ago by soheilazareie10

To know the location where the PDF will be saved, simply run this command:

getwd()

You can change the directory with:

setwd("/home/kblighe/results/")

In the code example that I have given, your data would be used in place of my object called data.

The only parameters that I have encouraged you to use in your own code are:

  • pdf() with width and height specified
  • pheatmap() with cex specified

You do not need to worry about any of the other parameters that I have used.

Trust this helps!

ADD REPLYlink written 4 weeks ago by Kevin Blighe25k
1

perfect, it worked, thanks so much!

Best, Soheila

ADD REPLYlink written 4 weeks ago by soheilazareie10

Good work!

ADD REPLYlink written 4 weeks ago by Kevin Blighe25k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 573 users visited in the last hour