Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,9 @@ object BammetricsReport extends ReportBuilder {
plot.input = tsvFile
plot.output = pngFile
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.runLocal()
}
......
......@@ -87,7 +87,7 @@ object FlexiprepReport extends ReportBuilder {
plot.input = tsvFile
plot.output = pngFile
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.runLocal()
}
......@@ -128,7 +128,7 @@ object FlexiprepReport extends ReportBuilder {
plot.input = tsvFile
plot.output = pngFile
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.runLocal()
}
......
......@@ -129,7 +129,9 @@ object ShivaReport extends MultisampleReportBuilder {
plot.input = tsvFile
plot.output = pngFile
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()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment