Commit cf653ddc authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added function to remove zero values

parent 2cb35802
......@@ -143,6 +143,7 @@ object BammetricsReport extends ReportBuilder {
plot.ylabel = Some("Reads")
plot.xlabel = Some("Insertsize")
plot.width = Some(1200)
plot.removeZero = true
plot.title = Some("Insertsize")
plot.runLocal()
......
......@@ -11,6 +11,7 @@ parser$add_argument('--xlabel', dest='xlabel', type='character')
parser$add_argument('--ylabel', dest='ylabel', type='character', required=TRUE)
parser$add_argument('--llabel', dest='llabel', type='character')
parser$add_argument('--title', dest='title', type='character')
parser$add_argument('--removeZero', dest='removeZero', type='character', default="false")
arguments <- parser$parse_args()
......@@ -24,7 +25,8 @@ colnames(DF)[1] <- "Rank"
DF1 <- melt(DF, id.var="Rank")
DF1 <- DF1[DF1$value > 0, ]
if (arguments$removeZero == "true") DF1 <- DF1[DF1$value > 0, ]
if (arguments$removeZero == "true") print("Removed 0 values")
ggplot(DF1, aes(x = Rank, y = value, group = variable, color = variable)) +
xlab(xlab) +
......
......@@ -24,6 +24,7 @@ class XYPlot(val root: Configurable) extends RscriptCommandLineFunction {
var ylabel: Option[String] = config("ylabel")
var llabel: Option[String] = config("llabel")
var title: Option[String] = config("title")
var removeZero: Boolean = config("removeZero", default = false)
override def cmdLine: String = super.cmdLine +
required("--input", input) +
......@@ -33,5 +34,6 @@ class XYPlot(val root: Configurable) extends RscriptCommandLineFunction {
optional("--xlabel", xlabel) +
required("--ylabel", ylabel) +
optional("--llabel", llabel) +
optional("--title", title)
optional("--title", title) +
optional("--removeZero", removeZero)
}
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