0

I have a matrix with gene expression values, and want to plot that in a heatmap. However, when I use the scaling option, scale = "row", some blank (greyed out) lines appear in the heatmap. Because of these, pheatmap doesn't allow any clustering based on the rows. When I draw the plot without scaling, there are no blank lines.

I suspect that this may be due to low variation and low expression in some of the rows, but there are no missing values in the expression data set.

p <- pheatmap(expression_matrix, 
         show_rownames=F, 
         show_colnames = T,
         clustering_distance_rows = "manhattan",
         cluster_cols=F,
         cluster_rows=F,
         annotation_col=df,
         annotation_colors = my_colors, 
         scale = "row")

I am looking for an explanation why this happens and a solution for avoiding it.

Plot before scaling:

enter image description here

Plot after scaling:

enter image description here

arvchi
  • 61
  • 11
  • Hi, please [provide data](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610), e.g. adding the output of `dput()` or `dput(head())` to your question. You'll have a much better chance of getting a great answer! – jay.sf Feb 11 '19 at 12:29
  • Thank you. Added plots for clarification. – arvchi Feb 11 '19 at 12:35
  • Data would still be necessary though. You may want to consider: https://stackoverflow.com/help/mcve – jay.sf Feb 11 '19 at 12:39

0 Answers0