Commit 0062bfa8 authored by Peter van 't Hof's avatar Peter van 't Hof

Added extension for stacked bar plot

parent d3ca07ab
......@@ -25,7 +25,9 @@ DF1 <- melt(DF, id.var="Rank")
ggplot(DF1, aes(x = Rank, y = value, fill = variable)) +
xlab(xlab) +
ylab(arguments$ylabel) + guides(fill=guide_legend(title=arguments$llabel)) +
geom_bar(stat = "identity")
ylab(arguments$ylabel) +
guides(fill=guide_legend(title=arguments$llabel)) +
theme(axis.text.x = element_text(angle = 90, hjust = 1, size = 8)) +
geom_bar(stat = "identity", width=0.75)
dev.off()
package nl.lumc.sasc.biopet.extensions.rscript
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions.RscriptCommandLineFunction
import org.broadinstitute.gatk.utils.commandline.{Output, Input}
/**
* Created by pjvan_thof on 4/29/15.
*/
class StackedBarPlot(val root: Configurable) extends RscriptCommandLineFunction {
protected var script: File = config("script", default = "stackedBar.R")
@Input
var input: File = _
@Output
var output: File = _
var width: Option[Int] = config("width")
var height: Option[Int] = config("height")
var xlabel: Option[String] = config("xlabel")
var ylabel: Option[String] = config("ylabel")
var llabel: Option[String] = config("llabel")
override def cmdLine: String = super.cmdLine +
required("--input", input) +
required("--output", output) +
optional("--width", width) +
optional("--height", height) +
optional("--xlabel", xlabel) +
required("--ylabel", ylabel) +
optional("--llabel", llabel)
}
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