Commit 48798284 authored by Peter van 't Hof's avatar Peter van 't Hof

Added plots

parent 5267fdf9
......@@ -21,4 +21,4 @@ dev.off()
png(file = outputArgClustering, width = 1500, height = 1500)
heatmap.2(heat, trace = 'none', col = col, Colv="Rowv", dendrogram="row",margins = c(10, 10))
dev.off()
\ No newline at end of file
dev.off()
library('gplots')
library('ggplot2')
library('reshape2')
args <- commandArgs(TRUE)
inputArg <- args[1]
outputArg <- args[2]
print(inputArg)
print(outputArg)
tsv<-read.table(inputArg, header = 1, sep= '\t', stringsAsFactors = F)
print(inputArg)
print(outputArg)
data <- melt(tsv)
#colnames(data) <- c("x", "sample", "value")
data$X <- as.numeric(data$X)
data <- na.omit(data)
data <- data[data$value > 0,]
print(inputArg)
print(outputArg)
print("Starting to plot")
png(file = outputArg, width = 1500, height = 1500)
ggplot(data, aes(x=X, y=value, color=variable, group=variable)) + geom_line()
dev.off()
print("plot done")
......@@ -107,6 +107,7 @@ object VcfStats extends ToolCommand {
writer.println(values.mkString(key + "\t", "\t", ""))
}
writer.close()
plotXy(file)
}
}
......@@ -149,7 +150,14 @@ object VcfStats extends ToolCommand {
def plotHeatmap(file: File) {
val executor = new RScriptExecutor
executor.addScript(new Resource("plotHeatmap.R", getClass))
executor.addArgs(file, file.getAbsolutePath.stripSuffix(".tsv") + ".png", file.getAbsolutePath.stripSuffix(".tsv") + ".clustering.png")
executor.addArgs(file, file.getAbsolutePath.stripSuffix(".tsv") + ".heatmap.png", file.getAbsolutePath.stripSuffix(".tsv") + ".heatmap.clustering.png")
executor.exec()
}
def plotXy(file: File) {
val executor = new RScriptExecutor
executor.addScript(new Resource("plotXY.R", getClass))
executor.addArgs(file, file.getAbsolutePath.stripSuffix(".tsv") + ".xy.png")
executor.exec()
}
}
Markdown is supported
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