Commit dd7f8389 authored by bow's avatar bow
Browse files

Update heatmap plotting script

parent 4b348b21
...@@ -126,7 +126,7 @@ plotHeatmap <- function(in.data, out.name=OUTPUT.PLOT, count.type=COUNT.TYPE, tm ...@@ -126,7 +126,7 @@ plotHeatmap <- function(in.data, out.name=OUTPUT.PLOT, count.type=COUNT.TYPE, tm
dev.off() dev.off()
} }
plotPlaceholder <- function(out.name=OUTPUT.PLOT, text.display="Not enough data points for plotting") { plotPlaceholder <- function(text.display, out.name=OUTPUT.PLOT) {
png(out.name, height=800, width=800, res=100) png(out.name, height=800, width=800, res=100)
par(mar=c(0,0,0,0)) par(mar=c(0,0,0,0))
plot(c(0, 1), c(0, 1), ann=F, bty='n', type='n', xaxt='n', yaxt='n') plot(c(0, 1), c(0, 1), ann=F, bty='n', type='n', xaxt='n', yaxt='n')
...@@ -139,7 +139,7 @@ plotPlaceholder <- function(out.name=OUTPUT.PLOT, text.display="Not enough data ...@@ -139,7 +139,7 @@ plotPlaceholder <- function(out.name=OUTPUT.PLOT, text.display="Not enough data
parsed <- tryCatch( parsed <- tryCatch(
prepTable(INPUT.PATH), prepTable(INPUT.PATH),
error=function (e) { error=function (e) {
plotPlaceholder(text.display="Error occured during table parsing") plotPlaceholder(text.display="Error occured during table prep")
q(status=0) q(status=0)
}) })
...@@ -147,5 +147,5 @@ if (nrow(parsed) > 0) { ...@@ -147,5 +147,5 @@ if (nrow(parsed) > 0) {
cors <- cor(parsed, method="spearman") cors <- cor(parsed, method="spearman")
tryCatch(plotHeatmap(cors), error=function (e) plotPlaceholder(text.display="Error occured during plotting")) tryCatch(plotHeatmap(cors), error=function (e) plotPlaceholder(text.display="Error occured during plotting"))
} else { } else {
plotPlaceholder() plotPlaceholder(text.display="Not enough data points for plotting")
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment