Commit 491e3410 authored by rhpvorderman's avatar rhpvorderman

Formatting

parent c639a8b7
...@@ -50,16 +50,20 @@ object BammetricsReport extends ReportBuilder { ...@@ -50,16 +50,20 @@ object BammetricsReport extends ReportBuilder {
def pipelineName = "bammetrics" def pipelineName = "bammetrics"
/** Root page for single BamMetrcis report */ /** Root page for single BamMetrcis report */
def indexPage: Future[ReportPage] ={ def indexPage: Future[ReportPage] = {
val bamMetricsValues: (Map[String, Boolean], Map[String, List[String]], Map[String, List[(String, Map[String, Any])]], Map[String, Map[String, Any]], String) = bamMetricsPageValues(summary, sampleId, libId) val bamMetricsValues: (Map[String, Boolean],
Map[String, List[String]],
Map[String, List[(String, Map[String, Any])]],
Map[String, Map[String, Any]],
String) = bamMetricsPageValues(summary, sampleId, libId)
bamMetricsPage(bamMetricsValues).map { bamMetricsPage => bamMetricsPage(bamMetricsValues).map { bamMetricsPage =>
ReportPage( ReportPage(
bamMetricsPage.subPages ::: List( bamMetricsPage.subPages ::: List(
"Versions" -> Future( "Versions" -> Future(
ReportPage(List(), ReportPage(List(),
List("Executables" -> ReportSection( List("Executables" -> ReportSection(
"/nl/lumc/sasc/biopet/core/report/executables.ssp")), "/nl/lumc/sasc/biopet/core/report/executables.ssp")),
Map())), Map())),
"Files" -> filesPage(sampleId, libId) "Files" -> filesPage(sampleId, libId)
), ),
List( List(
...@@ -69,13 +73,18 @@ object BammetricsReport extends ReportBuilder { ...@@ -69,13 +73,18 @@ object BammetricsReport extends ReportBuilder {
Map() Map()
) )
} }
} }
/** Generates values for bamMetricsPage */ /** Generates values for bamMetricsPage */
def bamMetricsPageValues(summary: SummaryDb, def bamMetricsPageValues(
sampleId: Option[Int], summary: SummaryDb,
libId: Option[Int], sampleId: Option[Int],
metricsTag: String = "bammetrics"): (Map[String, Boolean], Map[String, List[String]], Map[String, List[(String, Map[String, Any])]], Map[String, Map[String, Any]], String) = { libId: Option[Int],
metricsTag: String = "bammetrics"): (Map[String, Boolean],
Map[String, List[String]],
Map[String, List[(String, Map[String, Any])]],
Map[String, Map[String, Any]],
String) = {
val wgsExecuted = summary.getStatsSize(runId, val wgsExecuted = summary.getStatsSize(runId,
metricsTag, metricsTag,
"wgs", "wgs",
...@@ -178,27 +187,31 @@ object BammetricsReport extends ReportBuilder { ...@@ -178,27 +187,31 @@ object BammetricsReport extends ReportBuilder {
) )
Tuple5( Tuple5(
Map( Map("wgsExecuted" -> wgsExecuted,
"wgsExecuted" -> wgsExecuted, "rnaExecuted" -> rnaExecuted,
"rnaExecuted" -> rnaExecuted, "insertsizeMetrics" -> insertsizeMetrics),
"insertsizeMetrics" -> insertsizeMetrics),
Map("targets" -> targets), Map("targets" -> targets),
Map("covstatsPlotValuesList" -> covstatsPlotValuesList), Map("covstatsPlotValuesList" -> covstatsPlotValuesList),
Map( Map(
"alignmentSummaryReportValues" -> alignmentSummaryReportValues, "alignmentSummaryReportValues" -> alignmentSummaryReportValues,
"mappingQualityReportValues" -> mappingQualityReportValues, "mappingQualityReportValues" -> mappingQualityReportValues,
"clippingReportValues" -> clippingReportValues, "clippingReportValues" -> clippingReportValues,
"insertSizeReportValues" -> insertSizeReportValues, "insertSizeReportValues" -> insertSizeReportValues,
"wgsHistogramReportValues" -> wgsHistogramReportValues, "wgsHistogramReportValues" -> wgsHistogramReportValues,
"rnaHistogramReportValues" -> rnaHistogramReportValues "rnaHistogramReportValues" -> rnaHistogramReportValues
), ),
metricsTag metricsTag
) )
} }
/** Generates a page with alignment stats */ /** Generates a page with alignment stats */
def bamMetricsPage(bamMetricsPageValues:(Map[String, Boolean], Map[String, List[String]], Map[String, List[(String, Map[String, Any])]], Map[String, Map[String, Any]], String)): Future[ReportPage] = { def bamMetricsPage(
bamMetricsPageValues: (Map[String, Boolean],
Map[String, List[String]],
Map[String, List[(String, Map[String, Any])]],
Map[String, Map[String, Any]],
String)): Future[ReportPage] = {
val wgsExecuted = bamMetricsPageValues._1("wgsExecuted") val wgsExecuted = bamMetricsPageValues._1("wgsExecuted")
val rnaExecuted = bamMetricsPageValues._1("rnaExecuted") val rnaExecuted = bamMetricsPageValues._1("rnaExecuted")
......
...@@ -342,7 +342,8 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -342,7 +342,8 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
FlexiprepReadSummary.values(summary, runId, samples, libraries, sampleId, libId) FlexiprepReadSummary.values(summary, runId, samples, libraries, sampleId, libId)
val flexiprepBaseSummary = val flexiprepBaseSummary =
FlexiprepBaseSummary.values(summary, runId, samples, libraries, sampleId, libId) FlexiprepBaseSummary.values(summary, runId, samples, libraries, sampleId, libId)
val bamMetricsReportValues = BammetricsReport.bamMetricsPageValues(summary, Some(sampleId), libId) val bamMetricsReportValues =
BammetricsReport.bamMetricsPageValues(summary, Some(sampleId), libId)
Future { Future {
ReportPage( ReportPage(
...@@ -419,13 +420,55 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -419,13 +420,55 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
mustHaveLibrary = true), mustHaveLibrary = true),
Duration.Inf) >= 1 Duration.Inf) >= 1
val flexiprepPageSummaries = FlexiprepReport.flexiprepPageSummaries(summary, sampleId, libId) val flexiprepPageSummaries = FlexiprepReport.flexiprepPageSummaries(summary, sampleId, libId)
val bamMetricsReportValues = BammetricsReport.bamMetricsPageValues(summary, Some(sampleId), Some(libId)) val bamMetricsReportValues =
val centrifugeAllMappingsReportValues = GearsKronaPlot.values(summary, runId, "gearscentrifuge","centrifuge_report",samples,libraries,Some(sampleId),Some(libId), centrifugeTag = Some("centrifuge")) BammetricsReport.bamMetricsPageValues(summary, Some(sampleId), Some(libId))
val centrifugeUniqueMappingsReportValues = GearsKronaPlot.values(summary, runId, "gearscentrifuge","centrifuge_unique_report",samples,libraries,Some(sampleId),Some(libId), centrifugeTag = Some("centrifuge")) val centrifugeAllMappingsReportValues = GearsKronaPlot.values(summary,
val krakenDustbinAnalysisReportValues = GearsKronaPlot.values(summary, runId, "gearskraken","krakenreport",samples,libraries,Some(sampleId),Some(libId)) runId,
val alignmentSummaryReportValues = BammetricsReportPage.alignmentSummaryValues(summary,runId,samples,libraries,Some(sampleId),Some(libId)) "gearscentrifuge",
val flexiprepReadSummaryReportValues = FlexiprepReadSummary.values(summary, runId, samples, libraries, Some(sampleId),Some(libId)) "centrifuge_report",
val flexiprepBaseSummaryReportValues = FlexiprepBaseSummary.values(summary, runId, samples, libraries, Some(sampleId),Some(libId)) samples,
libraries,
Some(sampleId),
Some(libId),
centrifugeTag =
Some("centrifuge"))
val centrifugeUniqueMappingsReportValues = GearsKronaPlot.values(summary,
runId,
"gearscentrifuge",
"centrifuge_unique_report",
samples,
libraries,
Some(sampleId),
Some(libId),
centrifugeTag =
Some("centrifuge"))
val krakenDustbinAnalysisReportValues = GearsKronaPlot.values(summary,
runId,
"gearskraken",
"krakenreport",
samples,
libraries,
Some(sampleId),
Some(libId))
val alignmentSummaryReportValues = BammetricsReportPage.alignmentSummaryValues(
summary,
runId,
samples,
libraries,
Some(sampleId),
Some(libId))
val flexiprepReadSummaryReportValues = FlexiprepReadSummary.values(summary,
runId,
samples,
libraries,
Some(sampleId),
Some(libId))
val flexiprepBaseSummaryReportValues = FlexiprepBaseSummary.values(summary,
runId,
samples,
libraries,
Some(sampleId),
Some(libId))
Future { Future {
ReportPage( ReportPage(
("Alignment" -> BammetricsReport.bamMetricsPage(bamMetricsReportValues)) :: ("Alignment" -> BammetricsReport.bamMetricsPage(bamMetricsReportValues)) ::
...@@ -443,7 +486,8 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -443,7 +486,8 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
List("Unique mappings" -> ReportSection( List("Unique mappings" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp", "/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
centrifugeUniqueMappingsReportValues)), centrifugeUniqueMappingsReportValues)),
Map("summaryPipelineName" -> "gearscentrifuge", "centrifugeTag" -> Some("centrifuge")) Map("summaryPipelineName" -> "gearscentrifuge",
"centrifugeTag" -> Some("centrifuge"))
))) )))
else else
Nil) ::: (if (krakenExecuted) Nil) ::: (if (krakenExecuted)
...@@ -451,17 +495,21 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -451,17 +495,21 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
"Dustbin analysis" -> Future.successful( "Dustbin analysis" -> Future.successful(
ReportPage(List(), ReportPage(List(),
List("Krona Plot" -> ReportSection( List("Krona Plot" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",krakenDustbinAnalysisReportValues)), "/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp",
krakenDustbinAnalysisReportValues)),
Map()))) Map())))
else Nil), else Nil),
"Alignment" -> ReportSection( "Alignment" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp", alignmentSummaryReportValues) :: "/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp",
alignmentSummaryReportValues) ::
(if (flexiprepExecuted) (if (flexiprepExecuted)
List( List(
"QC reads" -> ReportSection( "QC reads" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp",flexiprepReadSummaryReportValues), "/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp",
flexiprepReadSummaryReportValues),
"QC bases" -> ReportSection( "QC bases" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp", flexiprepBaseSummaryReportValues) "/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp",
flexiprepBaseSummaryReportValues)
) )
else Nil), else Nil),
args args
......
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