pheatmap

R heatmaply and pheatmap output

廉价感情. 提交于 2020-06-17 01:01:11
问题 I am using the R heatmaply package to produce interactive heatmaps. I like the software, but I would like to get from it the same color output I get using the pheatmap package. Therefore, I would like the two commands to produce the same ouput: heatmaply (scale (mtcars)) pheatmap (scale (mtcars)) Is there a way to do this? Thanks in advance. Arturo 回答1: You can use formals() to get the default color argument of pheatmap() . formals(pheatmap)$color # colorRampPalette(rev(brewer.pal(n = 7, name

R heatmaply and pheatmap output

試著忘記壹切 提交于 2020-06-17 01:01:09
问题 I am using the R heatmaply package to produce interactive heatmaps. I like the software, but I would like to get from it the same color output I get using the pheatmap package. Therefore, I would like the two commands to produce the same ouput: heatmaply (scale (mtcars)) pheatmap (scale (mtcars)) Is there a way to do this? Thanks in advance. Arturo 回答1: You can use formals() to get the default color argument of pheatmap() . formals(pheatmap)$color # colorRampPalette(rev(brewer.pal(n = 7, name

Set 0-point for pheatmap in R

落爺英雄遲暮 提交于 2020-05-10 08:49:50
问题 How can you set the 0-point on the color scale to white in this heatmap? Does it use the breaks parameter? In the following code, white is set to 3 (or nearby on the scale): 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) = paste("Test", 1:10, sep = "") rownames(test) = paste("Name", 1:20, sep = "") pheatmap(test,

Heatmap with customized color scale bar for values below and above thresholds

痴心易碎 提交于 2020-01-14 03:33:09
问题 I would like to make an heatmap in R using pheatmap with the colors green, black and red and using a range in the legend from -2 to 2, here is the code that I used: library(pheatmap) my_palette <- colorRampPalette(c("green", "black", "red"))(n = 201) colors = c(seq(as.numeric(-2),-0.01,length=100), 0, seq(0.01,as.numeric(2),length=100)) pheatmap(mFilt_annot_sort_matrix, color = my_palette, breaks = colors, scale = "none", cluster_rows = F, cluster_cols = F, margin = c(5,5)) The problem is

Column labels cropped when using pheatmap

て烟熏妆下的殇ゞ 提交于 2019-12-29 07:55:08
问题 I am plotting a heatmap using pheatmap (Documentation). I am plotting a matrix in a fairly straightforward way: pheatmap(mat, annotation_col=df, labels_col=rld$Infection_Line, fontsize_row=5, fontsize_col=7) The bottom of my plot is getting cut off so that I can't see the column names at the bottom. It looks like this: Please note that this is not heatmap.2. I have tried the solutions at this question and at this question, as well as other things I've been able to find through google and in

Heatmap of categorical variable counts

谁说我不能喝 提交于 2019-12-24 14:05:45
问题 I have a data frame of items, and each has multiple classifier columns that are categorical variables. ID test1 test2 test3 1 A B A 2 B A C 3 C C C 4 A A B 5 B B B 6 B A C I want to generate a heatmap for each combination of test columns (test1 v test2, test1 v test3, etc.) using ggplot2. The heatmap would have all factors in that test's column (in this case A,B,C) on the x-side and all factors of the other test on the y-side, and the boxes in the heatmap should be colored based on the count

change line width of dendrogram in pheatmap in R

吃可爱长大的小学妹 提交于 2019-12-23 00:08:54
问题 I have used single cell RNA-seq data stored in a single cell experiment assay to perform hierarchical clustering of ~ 11.3000 expressed genes (not clustering samples) using pheatmap in R to show the heterogeneity of the data. I need the output image to be 2 x 4 inches, which makes the dendrogram a blur. Is it possible to reduce the line width used for the dendrogram? I tried setting the line width by gpar, but it doesn't seem to change sessionInfo() R version 3.4.1 (2017-06-30) Platform: i386

Pheatmap Color for Specific Value

不羁的心 提交于 2019-12-22 11:37:17
问题 I am very new to R and recently I have been playing around with the pheatmap library to generate, well, heatmaps. My problem is that I want to color my heatmap in a specific way. I'll describe below: Values < 1 should be a color ramp (e.g. dark blue to light blue) A value exactly equal to 1 should be dark grey Values > 1 should be a color ramp (e.g. dark red to light red) I have played around with the breaks parameter and the color parameter with various palettes but I can't seem to nail a

Discontionous heatmap in R

左心房为你撑大大i 提交于 2019-12-10 21:05:28
问题 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 color. All links I could find plotted a continuous matrix http://www.r-bloggers.com/ggheat-a-ggplot2-style-heatmap-function/ or interpolated. But I wish neither of the aforementioned, I want to plot discontinuous heatmap as in the images above. 回答1: The second one is a

Something weird in pheatmap (a bug?)

ⅰ亾dé卋堺 提交于 2019-12-10 10:58:09
问题 Reproducible Data: data(crabs, package = "MASS") df <- crabs[-(1:3)] set.seed(12345) df$GRP <- kmeans(df, 4)$cluster df.order <- dplyr::arrange(df, GRP) Data Description: df has 5 numerical variables. I did the K-means algorithm according to these 5 attributes and produced a new categorical variable GRP which has 4 levels. Next, I ordered it with GRP and named it df.order . What I did with pheatmap : ## 5 numerical variables for coloring colormat <- df.order[c("FL", "RW", "CL", "CW", "BD")] #