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

Skipped flexiprep stats when flexiprep is not executed

parent b2156b2c
...@@ -28,6 +28,9 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -28,6 +28,9 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
val wgsExecuted = summary.getSampleValues("bammetrics", "stats", "wgs").values.exists(_.isDefined) val wgsExecuted = summary.getSampleValues("bammetrics", "stats", "wgs").values.exists(_.isDefined)
val rnaExecuted = summary.getSampleValues("bammetrics", "stats", "rna").values.exists(_.isDefined) val rnaExecuted = summary.getSampleValues("bammetrics", "stats", "rna").values.exists(_.isDefined)
val flexiprepExecuted = summary.getLibraryValues("flexiprep")
.filter(_._2.isDefined)
.nonEmpty
ReportPage( ReportPage(
List("Samples" -> generateSamplesPage(pageArgs)) ++ List("Samples" -> generateSamplesPage(pageArgs)) ++
...@@ -51,25 +54,38 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -51,25 +54,38 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
(if (rnaExecuted) List("Rna coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/rnaHistogram.ssp", (if (rnaExecuted) List("Rna coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/rnaHistogram.ssp",
Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false))) Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)))
else Nil) ++ else Nil) ++
List("QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp", (if (flexiprepExecuted) List("QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp",
Map("showPlot" -> true, "showTable" -> false)), Map("showPlot" -> true, "showTable" -> false)),
"QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp", "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp",
Map("showPlot" -> true, "showTable" -> false)) Map("showPlot" -> true, "showTable" -> false))
), )
else Nil),
pageArgs pageArgs
) )
} }
/** Files page, can be used general or at sample level */ /** Files page, can be used general or at sample level */
def filesPage: ReportPage = ReportPage(List(), List( def filesPage: ReportPage = {
"Input fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepInputfiles.ssp"), val flexiprepExecuted = summary.getLibraryValues("flexiprep")
"After QC fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepOutputfiles.ssp"), .filter(_._2.isDefined)
"Bam files per lib" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp", Map("sampleLevel" -> false)), .nonEmpty
"Preprocessed bam files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp",
Map("pipelineName" -> pipelineName, "fileTag" -> "output_bam_preprocess"))), Map()) ReportPage(List(), (if (flexiprepExecuted) List(
"Input fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepInputfiles.ssp"),
"After QC fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepOutputfiles.ssp"))
else Nil) :::
List("Bam files per lib" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp", Map("sampleLevel" -> false)),
"Preprocessed bam files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp",
Map("pipelineName" -> pipelineName, "fileTag" -> "output_bam_preprocess"))), Map())
}
/** Single sample page */ /** Single sample page */
def samplePage(sampleId: String, args: Map[String, Any]): ReportPage = { def samplePage(sampleId: String, args: Map[String, Any]): ReportPage = {
val flexiprepExecuted = summary.getLibraryValues("flexiprep")
.filter(_._1._1 == sampleId)
.filter(_._2.isDefined)
.nonEmpty
ReportPage(List( ReportPage(List(
"Libraries" -> generateLibraryPage(args), "Libraries" -> generateLibraryPage(args),
"Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), None), "Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), None),
...@@ -78,9 +94,10 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -78,9 +94,10 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
"Alignment" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp", "Alignment" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp",
if (summary.libraries(sampleId).size > 1) Map("showPlot" -> true) else Map()), if (summary.libraries(sampleId).size > 1) Map("showPlot" -> true) else Map()),
"Preprocessing" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp", Map("sampleLevel" -> true))) ++ "Preprocessing" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp", Map("sampleLevel" -> true))) ++
List("QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"), (if (flexiprepExecuted) List("QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp") "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp")
), args) )
else Nil), args)
} }
/** Library page */ /** Library page */
...@@ -88,11 +105,11 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -88,11 +105,11 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
val flexiprepExecuted = summary.getValue(Some(sampleId), Some(libId), "flexiprep").isDefined val flexiprepExecuted = summary.getValue(Some(sampleId), Some(libId), "flexiprep").isDefined
ReportPage( ReportPage(
("Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), Some(libId))) :: ("Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), Some(libId))) ::
(if (flexiprepExecuted) List("QC" -> FlexiprepReport.flexiprepPage) else Nil), (if (flexiprepExecuted) List("QC" -> FlexiprepReport.flexiprepPage) else Nil),
List( "Alignment" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp") ::
"Alignment" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp"), (if (flexiprepExecuted) List("QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"QC reads" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"), "QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"))
"QC bases" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp") else Nil),
), args) args)
} }
} }
\ No newline at end of file
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