# HG changeset patch # User moheydarian # Date 1493322600 14400 # Node ID 817f255101c68308d363476f48009e216412ae24 # Parent d5f333f96a0d77afaa18c32e5e30e98cab8761b3 Uploaded diff -r d5f333f96a0d -r 817f255101c6 heatmap2.R --- a/heatmap2.R Thu Apr 27 15:33:38 2017 -0400 +++ b/heatmap2.R Thu Apr 27 15:50:00 2017 -0400 @@ -43,6 +43,10 @@ mat_input <- data.matrix(input[,2:ncol(input)]) rownames(mat_input) <- input[,1] + +hclust_fun = function(x) hclust(x, method="complete") +dist_fun = function(x) dist(x, method="maximum") + if(options$transform == "none"){ linput <- mat_input }else if(options$transform == "log2"){ @@ -67,15 +71,13 @@ if(options$cluster== "Default"){ - hclust_fun = function(x) hclust(x, method="complete") - dist_fun = function(x) dist(x, method="maximum") dclust = distfun=dist_fun hclust = hclustfun=hclust_fun - dend = NULL + dend = "both" }else{ dclust = NULL hclust = NULL - dend = dendrogram = "none" + dend = "none" } if(options$labels== "both"){ @@ -99,7 +101,7 @@ pdf(file="Rplot.pdf") colorscale heatmap.2(linput, - dclust, hclust, dend, scale = options$scale, labRow = rlabs, labCol = clabs, + dclust, hclust, dendrogram=dend, scale = options$scale, labRow = rlabs, labCol = clabs, col=colfunc(50), trace="none", density.info = "none", margins=c(8,2), main = options$title, key.xlab= options$key, keysize=1) dev.off()