Question: Pheatmap question, how to draw a heatmap with pheatmap when you have 200 DEG to show on the heatmap?
0
gravatar for soheilazareie
3 months 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 • 475 views
ADD COMMENTlink modified 3 months ago by Kevin Blighe30k • written 3 months ago by soheilazareie10

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

ADD REPLYlink modified 3 months ago • written 3 months ago by cpad01129.5k
1
gravatar for Kevin Blighe
3 months ago by
Kevin Blighe30k
Republic of Ireland
Kevin Blighe30k 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 3 months ago by Kevin Blighe30k

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 3 months ago • written 3 months 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 3 months ago by Kevin Blighe30k
1

perfect, it worked, thanks so much!

Best, Soheila

ADD REPLYlink written 3 months ago by soheilazareie10

Good work!

ADD REPLYlink written 3 months ago by Kevin Blighe30k
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: 1037 users visited in the last hour