Closed ndrubins closed 7 years ago
hi @ndrubins , are you sure this is the right repository for this issue? this is heatmap.js
not heatmapr
Sorry about about that @pa7. I meant to post it on https://github.com/talgalili/heatmaply/issues.
Is it possible to delete this issue?
@ndrubins no worries, I just closed it
Hi, I was wondering if it will be possible to create a
heatmapr
object wherecellnote
is acharacter
matrix
rather than anumerical
one?In addition, there are situations where a use might like to manipulate the
dendrogram
originally obtained fromhierarchically
clustering
thematrix
on which theheatmap
was built, hence passingggdend
objects toRowv
andColv
- post the user's manipulation, rather thandendrogram
s can be useful.Here's an example, and how I plot everything with
plotly
: library(ggplot2) library(dendextend) library(plotly)dendogram data
my.mat <- matrix(rnorm(10*100),nrow=100,ncol=10,dimnames = list(paste("g",1:100,sep=""),paste("s",1:10,sep=""))) x <- as.matrix(scale(my.mat)) dd.col <- as.dendrogram(hclust(dist(x))) dd.row <- as.dendrogram(hclust(dist(t(x))))
hover over data (cellnote)
my.hover.mat <- matrix(paste(paste(rownames(my.mat),paste("description",1:100,sep=" "),sep=":"),colnames(my.mat),signif(my.mat,3),sep="''"),nrow=100,ncol=10)
here I cut the row
dendrogram
, convert it to aggdend
object, and manipulate thatI also convert the column
dendrogram
although not cutting ithere I create the ggplot figures for these 2
ggdend
objectsand finally plotting it all together
I guess the equivalent attempt with
heatmaply
would be to create aheatmapr
object like this:heatmapr.obj <- heatmapr(x=my.mat,Colv=ggdend.row,Rowv=ggdend.col,cellnote=my.hover.mat)