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

Auto scale plots on number of samples/libraries

parent f2645096
...@@ -83,7 +83,9 @@ object BammetricsReport extends ReportBuilder { ...@@ -83,7 +83,9 @@ object BammetricsReport extends ReportBuilder {
plot.input = tsvFile plot.input = tsvFile
plot.output = pngFile plot.output = pngFile
plot.ylabel = Some("Reads") plot.ylabel = Some("Reads")
plot.width = Some(1200) if (libraryLevel) {
plot.width = Some(200 + (summary.libraries.filter(s => sampleId.getOrElse(s._1) == s._1).foldLeft(0)(_ + _._2.size) * 10))
} else plot.width = Some(200 + (summary.samples.filter(s => sampleId.getOrElse(s) == s).size * 10))
plot.title = Some("Aligned reads") plot.title = Some("Aligned reads")
plot.runLocal() plot.runLocal()
} }
......
...@@ -87,7 +87,7 @@ object FlexiprepReport extends ReportBuilder { ...@@ -87,7 +87,7 @@ object FlexiprepReport extends ReportBuilder {
plot.input = tsvFile plot.input = tsvFile
plot.output = pngFile plot.output = pngFile
plot.ylabel = Some("Reads") plot.ylabel = Some("Reads")
plot.width = Some(750) plot.width = Some(200 + (summary.libraries.filter(s => sampleId.getOrElse(s._1) == s._1).foldLeft(0)(_ + _._2.size) * 10))
plot.title = Some("QC summary on " + read + " reads") plot.title = Some("QC summary on " + read + " reads")
plot.runLocal() plot.runLocal()
} }
...@@ -128,7 +128,7 @@ object FlexiprepReport extends ReportBuilder { ...@@ -128,7 +128,7 @@ object FlexiprepReport extends ReportBuilder {
plot.input = tsvFile plot.input = tsvFile
plot.output = pngFile plot.output = pngFile
plot.ylabel = Some("Bases") plot.ylabel = Some("Bases")
plot.width = Some(750) plot.width = Some(200 + (summary.libraries.filter(s => sampleId.getOrElse(s._1) == s._1).foldLeft(0)(_ + _._2.size) * 10))
plot.title = Some("QC summary on " + read + " bases") plot.title = Some("QC summary on " + read + " bases")
plot.runLocal() plot.runLocal()
} }
......
...@@ -129,7 +129,9 @@ object ShivaReport extends MultisampleReportBuilder { ...@@ -129,7 +129,9 @@ object ShivaReport extends MultisampleReportBuilder {
plot.input = tsvFile plot.input = tsvFile
plot.output = pngFile plot.output = pngFile
plot.ylabel = Some("VCF records") plot.ylabel = Some("VCF records")
plot.width = Some(1200) if (libraryLevel) {
plot.width = Some(200 + (summary.libraries.filter(s => sampleId.getOrElse(s._1) == s._1).foldLeft(0)(_ + _._2.size) * 10))
} else plot.width = Some(200 + (summary.samples.filter(s => sampleId.getOrElse(s) == s).size * 10))
plot.runLocal() 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