comparison tools/script.R @ 3:db5d126bf8d0 draft

planemo upload
author marpiech
date Thu, 22 Dec 2016 18:19:53 -0500
parents c5a812cdf478
children
comparison
equal deleted inserted replaced
2:27e62af48a5a 3:db5d126bf8d0
5 statsDataPath = args[2] 5 statsDataPath = args[2]
6 logFC = args[3] 6 logFC = args[3]
7 logCPM = args[4] 7 logCPM = args[4]
8 pValue = args[5] 8 pValue = args[5]
9 fdr = args[6] 9 fdr = args[6]
10
11 clusterRow = args[7]
12 clusterCol = args[8]
13 hclustMethod = args[9]
14
15 mgColumnNm = as.numeric(args[10])
16 mgRowNm = as.numeric(args[11])
17
18 pdfWidth = as.numeric(args[12])
19 pdfHeight = as.numeric(args[13])
20
21
22 if(clusterRow == "Yes"){
23 clusterRow = TRUE
24 } else {
25 clusterRow = NA
26 }
27
28 if(clusterCol == "Yes"){
29 clusterCol = TRUE
30 } else {
31 clusterCol = NA
32 }
10 33
11 require(preprocessCore) 34 require(preprocessCore)
12 require(gplots) 35 require(gplots)
13 36
14 #prepare counts data -------------------------------------------------------- 37 #prepare counts data --------------------------------------------------------
47 70
48 colnames(countDataNormLog) = colnames(countData) 71 colnames(countDataNormLog) = colnames(countData)
49 rownames(countDataNormLog) = rownames(countData) 72 rownames(countDataNormLog) = rownames(countData)
50 73
51 #svg("heatmap.svg", width = 3+length(names), height = 1/2*length(wh)) 74 #svg("heatmap.svg", width = 3+length(names), height = 1/2*length(wh))
52 pdf("heatmap.pdf") 75 pdf("heatmap.pdf", width = pdfWidth, height = pdfHeight)
53 76
54 heatmap.2( 77 heatmap.2(
55 countDataNormLog[wh, ], 78 countDataNormLog[wh, ],
56 density.info=c("none"), 79 density.info=c("none"),
57 hclustfun = function(x) hclust(x, method = "average"), 80 hclustfun = function(x) hclust(x, method = hclustMethod),
58 distfun = function(x) as.dist(1-cor(t(x))), 81 distfun = function(x) as.dist(1-cor(t(x))),
59 col = bluered(50), 82 col = bluered(50),
60 scale = 'row', 83 scale = "row",
61 trace = "none", #lwid = c(1, length(names)), lhei = c(1,1/3*length(wh)), 84 trace = "none",
62 # Rowv=NA, 85 Rowv = clusterRow,
63 Colv = NA, 86 Colv = clusterCol,
64 margins = c(7, 8) 87 margins = c(mgColumnNm, mgRowNm)
65 ) 88 )
66 89
67 dev.off() 90 dev.off()
68 91