comparison SMART/DiffExpAnal/DESeqTools/clusterPlot.R @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
comparison
equal deleted inserted replaced
17:b0e8584489e6 18:94ab73e8a190
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 }