Question: Please help with "pheatmap" in R
gravatar for seta
4.2 years ago by
seta1.4k wrote:

Hi all,

I am trying to show differentially expressed genes based on their log fold change on the heatmap using pheatmap, however, no desired picture yet. There are 3 samples under a treatment that compared with control, the minimum and maximum log fold change are -8.5 and +9.3, respectively, so I used threshold (Thr) of 8 to determine the color key range. Also, there are some missing value in data that specified with the sign of "-", in fact, the gene X is DE just in sample 3, so it missed in the samples 1 and 2. Could you please let me know how the pheatmap handle such values?

I used the below commands for creating heatmap:

data <- read.delim("heat.txt", header=T)
rnames <- data[,1]
mat <- data.matrix(data[,2:ncol(data)])
rownames(mat) <- rnames
Thr <- 8
mat[mat < -thr] <- -thr
mat[mat > thr] <- thr
pheatmap(mat, breaks=seq(from=-thr, to=thr), cluster_col=FALSE, cluster_row=FALSE, cellwidth=15, cellheight=5)

I have modified commands several times, but this dirty picture was regenerated.

enter image description here

As you could see: 1) The height of the heatmap is not adjusted and I don't know how to set it to have the whole picture with high resolution, could you please help me in this setting?

2) There is just blue color instead of the color spectrum. Actually, I want to show even small differences between samples (say one unit) using the color key. Please kindly help me what should I do?

As it's my first experience, your help is really required. I would appreciate it in advance.

pheatmap log fold change • 5.2k views
ADD COMMENTlink modified 4.0 years ago by TriS4.2k • written 4.2 years ago by seta1.4k

Can you check this ???

ADD REPLYlink written 4.2 years ago by dasdevashishdas120

Not the question you ask but the answer you deserve: have a look at ggplot2 for your plotting. Among more guidelines you can find on the internet there is for example:

ADD REPLYlink written 4.2 years ago by WouterDeCoster44k

Thank you for your comment, I'll try it. At the moment, however, I prefer to use pheatmap.

ADD REPLYlink written 4.2 years ago by seta1.4k
gravatar for TriS
4.0 years ago by
United States, Buffalo
TriS4.2k wrote:

for visualizatio purposes don't use log FC, use the original data. even more importantly, scale and center them and then plot them. make sure to inlcude your max/min of the scaled data in the scale or pheatmap won't draw them. alternatively, you can scale them directly in the pheatmap function.

also for visualization plot 3 normal vs 3 treated instead of just the 3 treated, that gives a much better idea of the variability across samples and the changes vs. your control.

check out in the pheatmap manual how to change text size (hint: fontsize_row/cols)

ADD COMMENTlink written 4.0 years ago by TriS4.2k
Please log in to add an answer.


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