Heatmap function
1
0
Entering edit mode
Mark Reimers ▴ 20
@mark-reimers-509
Last seen 10.2 years ago
Hi Marcus, You can calculate your own distances, using for example sum( abs(data[,i]-data[,j], na.rm=T) to compute the 'Manhattan' distance between samples i & j. If you put these into a symmetric matrix X, the R function as.dist(X) will transform these into a distance object you can use with hclust(). regards Mark >Hmm, your answer left me thinking about how to measure distances. Why >doesnt a distace function just calculate the distance between the values >that are there and leave out the NA:s? I have filtered away with the >B-test the spots that are supposedly not to be differentially expressed >and have only a subset of the total number of spots. Three slides of my 18 >have many NA:s. Should I exclude them therefor because the distance is to >affected? > >/ Marcus > > ********************************************************************** ********************* Marcus Gry Bj?rklund Royal Institute of Technology AlbaNova University Center Stockholm Center for Physics, Astronomy and Biotechnology Department of Molecular Biotechnology 106 91 Stockholm, Sweden Phone (office): +46 8 553 783 39 Fax: + 46 8 553 784 81 Visiting adress: Roslagstullsbacken 21, Floor 3 Delivery adress: Roslagsv?gen 30B -- Mark Reimers Assistant Professor, Biosciences, and Statistical Lead, Bioinformatics and Expression Analysis Facility, Karolinska Institute Stockholm (by WebMail)
• 1.1k views
ADD COMMENT
0
Entering edit mode
Liaw, Andy ▴ 360
@liaw-andy-125
Last seen 10.2 years ago
> From: Mark Reimers [mailto:Mark.Reimers@biosci.ki.se] > > Hi Marcus, > > You can calculate your own distances, using for example sum( > abs(data[,i]-data[,j], na.rm=T) to compute the 'Manhattan' > distance between samples i & j. If you put these into a > symmetric matrix X, the R function as.dist(X) will transform > these into a distance object you can use with hclust(). But this effectively treats components containing NAs as contributing 0 to the distance. Is that really a reasonable thing to do? As an example: point #1: 3, 7, NA, 6, 1 point #2: 5, NA, 1, 8, 0 Ignoring the NAs gives dist(1, 2) = |3-5| + |6-8| + |1-0|, which is the same as having: point #1: 3, 7, 1, 6, 1 point #2: 5, 7, 1, 8, 0 Is that really what you want? Andy > regards > > Mark > > >Hmm, your answer left me thinking about how to measure > distances. Why > >doesnt a distace function just calculate the distance between the > >values that are there and leave out the NA:s? I have > filtered away with > >the B-test the spots that are supposedly not to be differentially > >expressed and have only a subset of the total number of spots. Three > >slides of my 18 have many NA:s. Should I exclude them > therefor because > >the distance is to affected? > > > >/ Marcus > > > > > ************************************************************** > ***************************** > Marcus Gry Bj?rklund > > Royal Institute of Technology > AlbaNova University Center > Stockholm Center for Physics, Astronomy and Biotechnology > Department of Molecular Biotechnology 106 91 Stockholm, Sweden > > Phone (office): +46 8 553 783 39 > Fax: + 46 8 553 784 81 > Visiting adress: Roslagstullsbacken 21, Floor 3 > Delivery adress: Roslagsv?gen 30B > > > > -- > Mark Reimers > Assistant Professor, Biosciences, and > Statistical Lead, Bioinformatics and Expression Analysis > Facility, Karolinska Institute Stockholm (by WebMail) > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo> /bioconductor >
ADD COMMENT

Login before adding your answer.

Traffic: 647 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