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

Added framework for target report

parent f048ba61
...@@ -21,10 +21,11 @@ object ShivaReport extends MultisampleReportBuilder { ...@@ -21,10 +21,11 @@ object ShivaReport extends MultisampleReportBuilder {
// FIXME: Not yet finished // FIXME: Not yet finished
def indexPage = { def indexPage = {
val regions = regionsPage
ReportPage( ReportPage(
Map( Map("Samples" -> generateSamplesPage(pageArgs)) ++
"Samples" -> generateSamplesPage(pageArgs), (if (regions.isDefined) Map(regions.get) else Map()) ++
"Files" -> filesPage, Map("Files" -> filesPage,
"Versions" -> ReportPage(Map(), List(( "Versions" -> ReportPage(Map(), List((
"Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp" "Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
))), Map()) ))), Map())
...@@ -47,6 +48,32 @@ object ShivaReport extends MultisampleReportBuilder { ...@@ -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( def filesPage = ReportPage(Map(), List(
"Input fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepInputfiles.ssp"), "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"), "After QC fastq files" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepOutputfiles.ssp"),
......
...@@ -293,7 +293,15 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript { ...@@ -293,7 +293,15 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
def summaryFile = new File(outputDir, "Shiva.summary.json") def summaryFile = new File(outputDir, "Shiva.summary.json")
/** Settings of pipeline for summary */ /** 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 */ /** Files for the summary */
def summaryFiles = Map() def summaryFiles = Map()
......
Supports Markdown
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