Mercurial > repos > moheydarian > heatmap2
changeset 13:e75734b84e61 draft
Uploaded
author | moheydarian |
---|---|
date | Thu, 27 Apr 2017 13:01:01 -0400 |
parents | c1cb330e162e |
children | b3eb35cfc36d |
files | heatmap2.R |
diffstat | 1 files changed, 30 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/heatmap2.R Thu Apr 27 13:00:52 2017 -0400 +++ b/heatmap2.R Thu Apr 27 13:01:01 2017 -0400 @@ -22,6 +22,8 @@ 'transform', 'c', 2, 'character', 'key', 'k', 2, 'character', 'colorscheme', 'z', 2, 'character', + 'cluster', 'b', 2, 'character', + 'labels', 'a', 2, 'character', 'output', 'o', 2, 'character' ), byrow=TRUE, ncol=4); @@ -53,20 +55,42 @@ }else{ } -if(options$colorscheme == "Default"){ +if(options$colorscheme == "whrd"){ colorscale = colfunc <- colorRampPalette(c("white", "red")) -} else { +} else if(options$colorscheme == "whblu"){ + colorscale = colfunc <- colorRampPalette(c("white", "blue")) +}else if(options$colorscheme == "blwhre"){ colorscale = colfunc <- colorRampPalette(c("blue","white", "red")) +}else{ } -hclust_fun = function(x) hclust(x, method="complete") -dist_fun = function(x) dist(x, method="maximum") +if(options$cluster== "Default"){ + hclust_fun = function(x) hclust(x, method="complete") + dist_fun = function(x) dist(x, method="maximum") + clust = distfun=dist_fun, hclustfun=hclust_fun +}else{ + clust = NULL +} + +if(options$labels== "both"){ + labs = NULL +}else if(options$labels== "rows"){ + labs = labCol=FALSE +}else if(options$labels== "columns"){ + labs = labRow=FALSE +}else if(options$labels== "none"){ + labs = labRow=FALSE, labCol=FALSE +} else{ +} + + + pdf(file="Rplot.pdf") colorscale heatmap.2(linput, - distfun=dist_fun, hclustfun=hclust_fun, scale = "none", - col=colfunc(50), trace="none", density.info = "none",labRow=FALSE, margins=c(8,2), + clust, scale = options$scale, + col=colfunc(50), trace="none", density.info = "none", labs, margins=c(8,2), main = options$title, key.xlab= options$key, keysize=1) dev.off()