2 questions about aheatmap
Opened this issue · 3 comments
Rachelly commented
- 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? - 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.
renozao commented
- 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 githubdevel
branch), as I made some changes not yet on CRAN ormaster
so that NA values are better handled. - Use argument
color
, passing a vector of breaks named with colors (I think this works), or color in argumentcolor
and break values in argumentbreaks
.
Rachelly commented
Thanks!
- 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...?
- 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.
renozao commented
Once you installed the package from Github, calling library will load it,
as usual.
You only need to call github_install to install updates. It is similar to
install.packages but fetch the source package on GitHub.