pheatmap

R pheatmap: Perform clustering and show dendrograms PER ANNOTATION CATEGORY

我只是一个虾纸丫 提交于 2019-12-01 04:58:27
问题 I know how to group rows (genes) by annotation category using pheatmap, and I know how to perform Person's correlation clustering on the whole set of rows (genes), but what I would like to accomplish would be to perform clustering (and show independent dendrograms) on each category independently. Is that even possible? Or am I forced to create a separate heat map for each category to do the clustering on a category basis? Check my MWE below: set.seed(1) library(pheatmap) mymat <- matrix(rexp

R pheatmap: change annotation colors and prevent graphics window from popping up

混江龙づ霸主 提交于 2019-11-29 14:43:34
问题 Following up on this question, I found the pheatmap function (which offers me a lot more control on the stuff that I want to do than heatmap.2). I have 2 problems though: 1- I cannot change the colors of the annotation (categories) 2- The graphics window keeps popping up even when I am saving the output in a png file This is my MWE: library(pheatmap) library(RColorBrewer) cols <- colorRampPalette(brewer.pal(9, "Set1")) mymat <- matrix(rexp(600, rate=.1), ncol=12) colnames(mymat) <- c(rep(

Column labels cropped when using pheatmap

余生颓废 提交于 2019-11-29 11:39:48
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 the documentation for this function. I have tried to increase the margins using par() and oma(), as