How to get Heatmap based on Jensen-shannon metric using Matrix of miRNA Expression data?
1
1
Entering edit mode
8.3 years ago
kbun ▴ 10

We have a matrix of miRNA expression data (example below w/ random fake data):

miRNA               sample 1     sample 2     sample 3
hsa-miR-10a-3p      1280         2340         4321
hsa-mir-10-5p       45           48           50
hsa-mir-10b-5p      32           19           25

What is the simplest way to generate a heat map + dendrogram based on the jensen-shannon metric using the above data? Do we have to perform clustering and then generate a heat map, or is there an R library that incorporates everything?

EDIT:

Provided an example of what we are looking for below:

< image not found >

R RNA-Seq microrna miRNA • 2.4k views
ADD COMMENT
4
Entering edit mode
8.3 years ago

The R heatmap() and heatmap.2() functions can take row and column dendrograms as input. So something like this could work:

clust<-hclust(rowJSdist)
heatmap(data,Rowv=as.dendrogram(clust))

Or you could pass heatmap() the function that computes the distance (and also the one that does the clustering if you need something different from hclust).

ADD COMMENT
0
Entering edit mode

Hi, I'm confused-- I have the Matrix of miRNA data, and I produced a distance matrix using an implementation of Jensen-Shannon. How do I use this with hclust and heat map?

Thanks!

ADD REPLY
0
Entering edit mode

As in the example code I gave: rowJSdist stands for the distance matrix which contains distances between the rows of your data matrix. If you computed the distances between the columns then just replace Rowv by Colv in heatmap(). hclust will produce a dendrogram but it is a hclust object so it may need to be coerced into a dendrogram object for use by heatmap().

ADD REPLY

Login before adding your answer.

Traffic: 2094 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6