Commit 48b70e4b authored by Peter van 't Hof's avatar Peter van 't Hof

Added framework for target report

parent f048ba61
......@@ -21,13 +21,14 @@ object ShivaReport extends MultisampleReportBuilder {
// FIXME: Not yet finished
def indexPage = {
val regions = regionsPage
ReportPage(
Map(
"Samples" -> generateSamplesPage(pageArgs),
"Files" -> filesPage,
"Versions" -> ReportPage(Map(), List((
"Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
))), Map())
Map("Samples" -> generateSamplesPage(pageArgs)) ++
(if (regions.isDefined) Map(regions.get) else Map()) ++
Map("Files" -> filesPage,
"Versions" -> ReportPage(Map(), List((
"Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
))), Map())
),
List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/shivaFront.ssp"),
......@@ -47,6 +48,32 @@ object ShivaReport extends MultisampleReportBuilder {
)
}
def regionsPage = {
val roi = summary.getValue("shiva", "settings", "regions_of_interest")
val amplicon = summary.getValue("shiva", "settings", "amplicon_bed")
var regionPages: Map[String, ReportPage] = Map()
def createPage(name: String, amplicon: Boolean = false): ReportPage = {
//TODO: get target content
ReportPage(Map(), List(), Map())
}
amplicon match {
case Some(x: String) => regionPages += (x + " (Amplicon)") -> createPage(x, true)
case _ =>
}
roi match {
case Some(x: String) => regionPages += x -> createPage(x, false)
case Some(x: List[_]) => x.foreach(x => regionPages += x.toString -> createPage(x.toString, false))
case _ =>
}
if (regionPages.nonEmpty) Some("Regions" -> ReportPage(regionPages, List(), Map()))
else None
}
def filesPage = ReportPage(Map(), 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"),
......
......@@ -293,7 +293,15 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
def summaryFile = new File(outputDir, "Shiva.summary.json")
/** Settings of pipeline for summary */
def summarySettings = Map()
def summarySettings = {
val roiBedFiles: List[File] = config("regions_of_interest", Nil)
val ampliconBedFile: Option[File] = config("amplicon_bed")
Map(
"regions_of_interest" -> roiBedFiles.map(_.getName.stripSuffix(".bed")),
"amplicon_bed" -> ampliconBedFile.map(_.getName.stripSuffix(".bed"))
)
}
/** Files for the summary */
def summaryFiles = Map()
......
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