Commit d0d60c78 authored by rhpvorderman's avatar rhpvorderman

defutured mappingqualityreport in Bammetrics

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