Questions tagged [pheatmap]

A package for drawing pretty heatmaps in R.

pheatmap is a package for drawing pretty heatmaps in R. The ordinary heatmap function in R has several drawbacks when it comes to producing publication quality heatmaps. It is hard to produce pictures with consistent text, cell and overall sizes and shapes. The function pheatmap() tries to alleviate the problems by offering more fine grained control over heatmap dimensions and appearance.

Repositories

Resources

223 questions
3
votes
1 answer

How do I change annotation color in pheatmap?

Consider the matrix: test = matrix(rnorm(200), 20, 10) test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3 test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2 test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4 colnames(test) =…
user2110417
3
votes
1 answer

how to put key values and legends at the bottom of the heatmap

Does anyone show me how to put the expression key index and the legend key to appear at the bottom of the heatmap using pheatmap? you can use the following code to generate the heatmap. Thank you so much! test = matrix(rnorm(200), 20,…
adR
  • 305
  • 4
  • 14
3
votes
3 answers

How to reorder cluster leaves (columns) when plotting pheatmap in R?

I am plotting a set of 15 samples clustered in three groups A, B, C, and the heatmap orders them such as C, A, B. (I have read this is due to that it plots on the right the cluster with the strongest similarity). I would like to order the clusters…
Ecg
  • 908
  • 1
  • 10
  • 28
3
votes
1 answer

Pheatmap: Re-order leaves in dendogram

I have created a heatmap with a corresponding dendogram based on the hierarchical clustering, using the pheatmap package. Now, I want to change the order of the leaves in the dendogram. Preferably using the optimal leaves method. I have searched…
arvchi
  • 61
  • 11
3
votes
1 answer

Combining pheatmaps in R

I've been working around with no success in solving how 2 or more pheatmaps (heatmaps) can be combined in a final plot. data1 <- structure(list(DC1 = c(NA, NA, 1.98), DC2 = c(NA, NA, 0.14), DC3 = c(1.85, 1.51, 0.52), DC4 = c(0.89, 0.7, 1.47),…
antecessor
  • 2,688
  • 6
  • 29
  • 61
3
votes
1 answer

How to get color scale value (row z-score value) from R pheatmap

I have the following data frame: library(pheatmap) library(RColorBrewer) dat <- structure(c(36.28516213, -9.184523335, 5.716034994, 32.82180488, -18.5467127, 22.79930301, -24.79075287, -49.23768715), .Dim = c(2L, 4L), .Dimnames =…
littleworth
  • 4,781
  • 6
  • 42
  • 76
3
votes
0 answers

pheatmap column cluster annotation

I have following code for the heat map generation using "pheatmap" package. I am successful creating heat map but having very hard time to annotate the column. I have 9 cell types and each cell type has 3 replicates. Here is the data. I have…
3
votes
0 answers

How to use customized clustering function and metrics for pheatmap

I have the following function library(pheatmap) plot_kmeans_heatmap <- function (dat=NULL, k=3, nstart=20) { # Data wrangling ---------------------------------------------------------- set.seed(1) dat_m <- kmeans(dat, k, nstart =…
pdubois
  • 7,640
  • 21
  • 70
  • 99
3
votes
2 answers

Discontionous heatmap in R

I wish to create something similar to the following types of discontinuous heat map in R: My data is arranged as follows: k_e percent time .. .. .. .. .. .. I wish k_e to be x-axis, percent on y-axis and time to denote the…
Abhishek Bhatia
  • 9,404
  • 26
  • 87
  • 142
2
votes
1 answer

How to add two or more new lines in an expression in the main title in pheatmap

I have a small question about expression when I use it in the pheatmap. For example, I want to add information in the main title in a pheatmap plot with something in details. Here is my reproducible code: # main <- expression(bold(paste( # …
花落思量错
  • 352
  • 1
  • 11
2
votes
1 answer

Calculate dates based on completion date and make a heatmap

I have a dataset that looks like below df <- data.frame( id = 1:6, # New id column drinks_on_previous_day1 = c(5,4,2,1,5,4), drinks_on_previous_day2 = c(5,4,2,1,5,5), drinks_on_previous_day3 = c(5,4,2,1,5,6), drinks_on_previous_day4 =…
Fatima
  • 55
  • 4
2
votes
1 answer

pheatmap package different values same colour

I try to do a Heatmap on R and have four values (1,2,3,4) in my excel file that looks like…
2
votes
0 answers

R shiny: plotlyOutput and plotOutput conflict

There is a similar question here, but I haven't found a satisfactory answer. When I output two plot, one is interactive using plotly and one is static figure using R package pheatmep. The static image will not show in shiny page, but it shows in…
Wang
  • 1,314
  • 14
  • 21
2
votes
1 answer

Showing raw numbers in cells of pheatmap in R

Ok I've got a pretty basic problem I'm sure but I'm just too novice at R to fix it. I'm creating a heatmap using pheatmap and would like to display the raw numbers in each cell but also use scaling on the rows. The is issue is when I use…
JeffNKC
  • 21
  • 2
2
votes
1 answer

Pull out genes/observations from cutree_rows groups in pheatmap

How can you pull out the genes/observations from the row groups generated from cutree_rows = 3 in pheatmap? would be obj$tree_row$...? obj <- pheatmap(mat, annotation_col = anno, fontsize_row = 10, show_colnames = F, show_rownames = F, cutree_cols =…
Ecg
  • 908
  • 1
  • 10
  • 28
1 2
3
14 15