Commit b7cf21a7 authored by rhpvorderman's avatar rhpvorderman

Bug fixes

parent 974fceaa
......@@ -51,25 +51,42 @@ object FlexiprepReport extends ReportBuilder {
override def pageArgs = Map("multisample" -> false)
/** Index page for a flexiprep report */
def indexPage: Future[ReportPage] = this.flexiprepPage.map { flexiprepPage =>
ReportPage(
Nil,
List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFront.ssp")
) ::: flexiprepPage.sections,
Map())
def indexPage: Future[ReportPage] = this.flexiprepPage(summary, sampleId.get, libId.get).map {
page =>
ReportPage(
Nil,
List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFront.ssp")
) ::: page.sections,
Map())
}
/** Generate a QC report page for 1 single library, sampleId and libId must be defined in the arguments */
def flexiprepPage: Future[ReportPage] =
def flexiprepPage(summary: SummaryDb, sampleId: Int, libId: Int): Future[ReportPage] = {
val flexiprepReadSummary = FlexiprepReadSummary.values(summary,
runId,
samples,
libraries,
sampleId,
libId,
multisample = false)
val flexiprepBaseSummary = FlexiprepBaseSummary.values(summary,
runId,
samples,
libraries,
sampleId,
libId,
multisample = false)
Future(
ReportPage(
List(),
List(
"Read Summary" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp"),
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp",
flexiprepReadSummary),
"Base Summary" -> ReportSection(
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp"),
"/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp",
flexiprepBaseSummary),
fastqcPlotSection("Base quality", "plot_per_base_quality"),
fastqcPlotSection("Sequence quality", "plot_per_sequence_quality"),
fastqcPlotSection("Base GC content", "plot_per_base_gc_content"),
......@@ -82,6 +99,7 @@ object FlexiprepReport extends ReportBuilder {
),
Map()
))
}
protected def fastqcPlotSection(name: String, tag: String): (String, ReportSection) = {
name -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFastQcPlot.ssp",
......
......@@ -20,10 +20,6 @@
<%@ var runId: Int %>
<%@ var allSamples: Seq[Sample] %>
<%@ var allLibraries: Seq[Library] %>
<%-- Present already in summaries and total reads and therefore not necessary
--%>
<%-- Fix-BIOPET-669 addition. Removing futures from template --%>
<%@ val summaries: Map[Int, Map[String, Option[Any]]] %>
<%@ val totalReads: Option[Map[String, Long]] %>
#{
......
......@@ -330,7 +330,8 @@ object GearsReport extends MultisampleReportBuilder {
Duration.Inf)
val flexiprepReportPage =
if (flexiprepExecuted) Some("QC" -> FlexiprepReport.flexiprepPage) else None
if (flexiprepExecuted) Some("QC" -> FlexiprepReport.flexiprepPage(summary, sampleId, libId))
else None
val centrifugePageAllMappingsKronaPlot = GearsKronaPlot.values(summary,
runId,
......@@ -440,6 +441,16 @@ object GearsKronaPlot {
sampleId: Option[Int] = None,
libId: Option[Int] = None,
centrifugeTag: Option[String] = None): Map[String, Any] = {
val summariesVal =
summaries(summary, runId, sampleId, libId, summaryModuleTag, summaryStatsTag)
val totalReadsVal = totalReads(summary,
runId,
sampleId,
libId,
summaryModuleTag,
centrifugeTag,
allSamples,
allLibraries)
Map(
"summary" -> summary,
"runId" -> runId,
......@@ -450,15 +461,8 @@ object GearsKronaPlot {
"centrifugeTag" -> centrifugeTag,
"allSamples" -> allSamples,
"allLibraries" -> allLibraries,
"summaries" -> summaries(summary, runId, sampleId, libId, summaryModuleTag, summaryStatsTag),
"totalReads" -> totalReads(summary,
runId,
sampleId,
libId,
summaryModuleTag,
centrifugeTag,
allSamples,
allLibraries)
"summaries" -> summariesVal,
"totalReads" -> totalReadsVal
)
}
......
......@@ -66,7 +66,8 @@ object MappingReport extends ReportBuilder {
Some(BammetricsReport.bamMetricsPage(summary, sampleId, libId))
} else None
ReportPage(
(if (skipFlexiprep) Nil else List("QC" -> FlexiprepReport.flexiprepPage)) :::
(if (skipFlexiprep) Nil
else List("QC" -> FlexiprepReport.flexiprepPage(summary, sampleId.get, libId.get))) :::
bamMetricsPage.map(_.subPages).getOrElse(Nil),
List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/mappingFront.ssp")
......
......@@ -270,7 +270,9 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
ReportPage(
("Alignment" -> BammetricsReport.bamMetricsPage(summary, Some(sampleId), Some(libId))) ::
(if (flexiprepExecuted) List("QC" -> FlexiprepReport.flexiprepPage) else Nil) :::
(if (flexiprepExecuted)
List("QC" -> FlexiprepReport.flexiprepPage(summary, sampleId, libId))
else Nil) :::
(if (centrifugeExecuted)
List("Centriguge analysis" -> Future.successful(ReportPage(
List("Non-unique" -> Future.successful(
......
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