0

I have a big dataset with around 1000 significant hits calculated by anova. I can draw a beautiful heatmap using the pheatmap package. However, the heatmap is huge and I would like to look at bigger clusters in more detail. Can I somehow hide parts of the heatmap?

I have extracted clusters using cutree and made a heatmap with those. However, since part of the data is missing, the clustering is different. I really just want to hide the upper/lower/left/right part instead of recalculating the clustering with part of the data.

Let's say for example I have this pheatmap:

data(iris)
iris_heatmap <- iris[-5] %>% scale()
iris_heatmap <- iris_heatmap %>% as.data.frame()
pheatmap(as.matrix(iris_heatmap))

but instead of the whole picture being shown I only want to see this: cut pheatmap

I just dont want to cut the picture myself but have R do it.

Many thanks for your help!!

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58
  • Maybe output as jpeg then crop it, `magick::image_crop` , see https://cran.r-project.org/web/packages/magick/vignettes/intro.html – zx8754 Apr 26 '21 at 07:27
  • Thank you for your idea! This is an option but therefore I would need to actually know where to cut by pixel (as far as I understood). I would rather like to define where to cut by defining the clusters I want to show to maybe also be able to cut something out in the middle. Plus, I would loose all the information around it such as annotation of the columns if I cut at the wrong site. – doodles Apr 28 '21 at 14:13

0 Answers0