Mercurial > repos > yufei-luo > s_mart
comparison SMART/DiffExpAnal/DESeqTools/clusterPlot.R @ 31:0ab839023fe4
Uploaded
author | m-zytnicki |
---|---|
date | Tue, 30 Apr 2013 14:33:21 -0400 |
parents | 94ab73e8a190 |
children |
comparison
equal
deleted
inserted
replaced
30:5677346472b5 | 31:0ab839023fe4 |
---|---|
1 # clusterPlot | |
2 # dendrogram of sample clustering | |
3 | |
4 # input : counts, outputName, type of data (raw or norm) | |
5 # output : dendrogram (jpeg) | |
6 | |
7 # created Sept 13th, 2012 | |
8 # modified Oct 30th, 2012 | |
9 # Marie-Agnes Dillies | |
10 | |
11 | |
12 clusterPlot <- function( cds, OUT_clusterPlot, type = "raw", out = TRUE ){ | |
13 | |
14 if (out) png( file=OUT_clusterPlot ) | |
15 | |
16 if (type == "norm"){ | |
17 cdsblind <- estimateDispersions( cds, method="blind" ) | |
18 vsd <- getVarianceStabilizedData( cdsblind ) | |
19 } | |
20 else { | |
21 vsd <- counts(cds) | |
22 } | |
23 hc <- hclust( dist(t(vsd)), method="ward" ) | |
24 plot( hc, xlab = "Euclidean distance, Ward criterion", main=paste("Cluster Dendrogram, ", type, " data", sep="") ) | |
25 | |
26 if (out) dev.off() | |
27 } |