Commit d0d60c78 authored by rhpvorderman's avatar rhpvorderman

defutured mappingqualityreport in Bammetrics

parent 70dd869c
...@@ -248,8 +248,8 @@ object BammetricsReport extends ReportBuilder { ...@@ -248,8 +248,8 @@ object BammetricsReport extends ReportBuilder {
* @param pipeline Query for the pipeline * @param pipeline Query for the pipeline
* @param module Query for the module * @param module Query for the module
*/ */
def summaryForPlot( statsPaths: Map[String, List[String]], def summaryForPlot( summary: SummaryDb,
summary: SummaryDb, statsPaths: Map[String, List[String]],
yKeyList: List[String], yKeyList: List[String],
xKeyList: List[String], xKeyList: List[String],
pipeline: PipelineQuery, pipeline: PipelineQuery,
...@@ -257,7 +257,7 @@ object BammetricsReport extends ReportBuilder { ...@@ -257,7 +257,7 @@ object BammetricsReport extends ReportBuilder {
libraryLevel: Boolean = false, libraryLevel: Boolean = false,
sampleId: Option[Int] = None, sampleId: Option[Int] = None,
libraryId: Option[Int] = None libraryId: Option[Int] = None
): Any = { ): Array[Map[String, Array[Any]]]= {
val results: Map[(Int, Option[Int]), Map[String, Option[Array[Any]]]] = if (libraryLevel) { val results: Map[(Int, Option[Int]), Map[String, Option[Array[Any]]]] = if (libraryLevel) {
summary summary
.getStatsForLibraries(runId, pipeline, module, sampleId = sampleId, keyValues = statsPaths) .getStatsForLibraries(runId, pipeline, module, sampleId = sampleId, keyValues = statsPaths)
...@@ -307,8 +307,8 @@ object BammetricsReport extends ReportBuilder { ...@@ -307,8 +307,8 @@ object BammetricsReport extends ReportBuilder {
def writePlotFromSummary(outputDir: File, def writePlotFromSummary(outputDir: File,
prefix: String, prefix: String,
tables: Array[Map[String, Array[Any]]], tables: Array[Map[String, Array[Any]]],
xKeyList: List[String],
yKeyList: List[String], yKeyList: List[String],
xKeyList: List[String],
xlabel: Option[String] = None, xlabel: Option[String] = None,
ylabel: Option[String] = None, ylabel: Option[String] = None,
title: Option[String] = None, title: Option[String] = None,
...@@ -365,38 +365,38 @@ object BammetricsReport extends ReportBuilder { ...@@ -365,38 +365,38 @@ object BammetricsReport extends ReportBuilder {
) )
} }
def mappingQualityPlot(outputDir: File, def mappingQualityPlotSummary(summary: SummaryDb,
prefix: String, ): Unit = {
summary: SummaryDb,
libraryLevel: Boolean = false,
sampleId: Option[Int] = None,
libraryId: Option[Int] = None): Unit = {
val statsPaths = Map( val statsPaths = Map(
"mapping_quality" -> List("mapping_quality", "histogram", "values"), "mapping_quality" -> List("mapping_quality", "histogram", "values"),
"count" -> List("mapping_quality", "histogram", "counts") "count" -> List("mapping_quality", "histogram", "counts")
) )
summaryForPlot(statsPaths, val plotSummary: Array[Map[String, Array[Any]]] = summaryForPlot(summary, statsPaths,
"mapping_quality" :: Nil, "mapping_quality" :: Nil,
"count" :: Nil, "count" :: Nil,
"bammetrics", "bammetrics",
"bamstats" "bamstats"
)
writePlotFromSummary(
outputDir,
prefix,
summary,
libraryLevel,
sampleId,
libraryId,
statsPaths,
,
"Mapping quality",
"Reads",
"Mapping quality"
) )
plotSummary
} }
def mappingQualityPlot(outputDir: File,
prefix: String,
mappingQualityPlotSummary: Array[Map[String, Array[Any]]],
libraryLevel: Boolean = false,
sampleId: Option[Int] = None,
libraryId: Option[Int] = None): Unit = {
val statsPaths = Map(
"mapping_quality" -> List("mapping_quality", "histogram", "values"),
"count" -> List("mapping_quality", "histogram", "counts")
)
writePlotFromSummary(outputDir,
prefix,
mappingQualityPlotSummary,
"mapping_quality" :: Nil,
"count" :: Nil,"Mapping Quality", "Reads","Mapping Quality")
}
def clippingPlot(outputDir: File, def clippingPlot(outputDir: File,
prefix: String, prefix: String,
tables: Array[Map[String, Array[Any]]], tables: Array[Map[String, Array[Any]]],
......
...@@ -99,6 +99,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -99,6 +99,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
val centrifugeAnalysis = GearsKronaPlot.values(summary, runId, "gearscentrifuge", "centrifuge_report", samples, libraries, sampleId, libId ) val centrifugeAnalysis = GearsKronaPlot.values(summary, runId, "gearscentrifuge", "centrifuge_report", samples, libraries, sampleId, libId )
val centrifugeUniqueAnalysis = GearsKronaPlot.values(summary, runId, "gearscentrifuge", "centrifuge_unique_report", samples, libraries, sampleId, libId ) val centrifugeUniqueAnalysis = GearsKronaPlot.values(summary, runId, "gearscentrifuge", "centrifuge_unique_report", samples, libraries, sampleId, libId )
val alignmentSummary = BamMetricsAlignmentReport.values(summary, runId, samples, libraries, sampleId, libId, sampleLevel =true,showPlot=true,showTable=false) val alignmentSummary = BamMetricsAlignmentReport.values(summary, runId, samples, libraries, sampleId, libId, sampleLevel =true,showPlot=true,showTable=false)
val mappingQualitySummary= BammetricsReport.mappingQualityPlotSummary(summary)
Future { Future {
ReportPage( ReportPage(
List("Samples" -> generateSamplesPage(pageArgs)) ++ List("Samples" -> generateSamplesPage(pageArgs)) ++
......
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