renozao/FAQR

2 questions about aheatmap

Opened this issue · 3 comments

  1. I need a different color for NA values. I tried to use na.color but that doesn't work well since I have columns that are NAs only, and then I get the following error:
    Error in hclust(d, method = hclustfun) :
    NA/NaN/Inf in foreign function call (arg 11)
    Is there a work-around for this?
  2. I would like to have a fixed range for the colors I use in the heatmap, since I plot different heatmaps and want to be able to compare them (currently, each matrix has a different range of values so the colors are not comparable). Is there a way to do this?

Thanks,
Rachelly.

  1. Clustering will not work if you have columns full of NA. The only option in that case is to disable column clustering with Colv = NA.
    Also make sure you use the latest NMF version (from the github devel branch), as I made some changes not yet on CRAN or master so that NA values are better handled.
  2. Use argument color, passing a vector of breaks named with colors (I think this works), or color in argument color and break values in argument breaks.

Thanks!

  1. I worked around this by giving a very low value for NAs, one that is outside the normal range.

** In order to make sure I always use the latest version of NMF do I have to put the following line into the code
devtools::install_github('renozao/NMF', ref = 'devel')
or is there a more elegant way of doing this without downloading the package every time I source the code...?

  1. This worked nicely. I used only "breaks" (as color has a default value) and gave it a vector that is the range I wanted for all plots.