Commit d4b734b1 authored by akaljuvee's avatar akaljuvee

possibility to specify axis ticks and the labels used there

parent 0a868bd9
......@@ -42,6 +42,9 @@ class LinePlot(val root: Configurable) extends Rscript {
var xLog10: Boolean = false
var yLog10: Boolean = false
var xLog10AxisTicks: Seq[String] = Seq.empty
var xLog10AxisLabels: Seq[String] = Seq.empty
override def cmd = super.cmd ++
Seq("--input", input.getAbsolutePath) ++
Seq("--output", output.getAbsolutePath) ++
......@@ -53,7 +56,9 @@ class LinePlot(val root: Configurable) extends Rscript {
title.map(Seq("--title", _)).getOrElse(Seq()) ++
(if (removeZero) Seq("--removeZero", "true") else Seq()) ++
(if (xLog10) Seq("--xLog10", "true") else Seq()) ++
(if (yLog10) Seq("--yLog10", "true") else Seq())
(if (yLog10) Seq("--yLog10", "true") else Seq()) ++
(if (xLog10AxisTicks.nonEmpty) xLog10AxisTicks.+:("--xLog10Breaks") else Seq()) ++
(if (xLog10AxisTicks.nonEmpty) xLog10AxisLabels.+:("--xLog10Labels") else Seq())
}
......
......@@ -8,6 +8,7 @@ import nl.lumc.sasc.biopet.utils.summary.Summary
object ShivaSvCallingReport {
val histogramBinBoundaries: Array[Int] = Array(100, 1000, 10000, 100000, 1000000, 10000000)
val histogramPlotTicks: Array[Int] = Array(100, 1000, 10000, 100000, 1000000, 10000000, 100000000)
val histogramText: List[String] = List("<=100bp", "0.1-1kb", "1-10kb", "10-100kb", "0.1-1Mb", "1-10Mb", ">10Mb")
def parseSummaryForSvCounts(summary: Summary): Map[String, Map[String, Array[Any]]] = {
......@@ -60,15 +61,11 @@ object ShivaSvCallingReport {
sampleNames.foreach(sampleName => tsvWriter.print("\t" + sampleName))
tsvWriter.println()
for (i <- histogramBinBoundaries.indices) {
tsvWriter.print(histogramBinBoundaries(i))
for (i <- histogramPlotTicks.indices) {
tsvWriter.print(histogramPlotTicks(i))
sampleNames.foreach(sampleName => tsvWriter.print("\t" + counts.get(sampleName).get(i)))
tsvWriter.println()
}
val i = histogramBinBoundaries.length
tsvWriter.print(histogramBinBoundaries(i - 1) * 10)
sampleNames.foreach(sampleName => tsvWriter.print("\t" + counts.get(sampleName).get(i)))
tsvWriter.println()
tsvWriter.close()
}
......@@ -87,6 +84,8 @@ object ShivaSvCallingReport {
plot.llabel = Some("Sample")
plot.xLog10 = true
plot.yLog10 = true
plot.xLog10AxisTicks = histogramPlotTicks.collect({ case x => x.toString() })
plot.xLog10AxisLabels = histogramText
plot.runLocal()
}
......
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