MappingReport.scala 3.09 KB
Newer Older
Peter van 't Hof's avatar
Peter van 't Hof committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Biopet is built on top of GATK Queue for building bioinformatic
 * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
 * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
 * should also be able to execute Biopet tools and pipelines.
 *
 * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
 *
 * Contact us at: sasc@lumc.nl
 *
 * A dual licensing mode is applied. The source code within this project that are
 * not part of GATK Queue is freely available for non-commercial use under an AGPL
 * license; For commercial users or users who do not want to follow the AGPL
 * license, please contact us to obtain a separate license.
 */
16
17
package nl.lumc.sasc.biopet.pipelines.mapping

Peter van 't Hof's avatar
Peter van 't Hof committed
18
import nl.lumc.sasc.biopet.utils.config.Configurable
19
import nl.lumc.sasc.biopet.core.report._
20
21
22
23
import nl.lumc.sasc.biopet.pipelines.bammetrics.BammetricsReport
import nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport

class MappingReport(val root: Configurable) extends ReportBuilderExtension {
24
  def builder = MappingReport
25
26
27
}

/**
Peter van 't Hof's avatar
Peter van 't Hof committed
28
29
 * Object ot generate report for [[Mapping]]
 *
30
31
32
33
34
35
 * Created by pjvanthof on 24/06/15.
 */
object MappingReport extends ReportBuilder {
  /** Name of report */
  val reportName = "Mapping Report"

36
  override def extFiles = super.extFiles ++ List("js/gears.js")
Peter van 't Hof's avatar
Peter van 't Hof committed
37
    .map(x => ExtFile("/nl/lumc/sasc/biopet/pipelines/gears/report/ext" + x, x))
38
39
40

  def krakenExecuted = summary.getValue(sampleId, libId, "gears", "stats", "krakenreport").isDefined

41
42
  /** Root page for single BamMetrcis report */
  def indexPage = {
43
    val skipFlexiprep = summary.getValue(sampleId, libId, "mapping", "settings", "skip_flexiprep").getOrElse(false) == true
Peter van 't Hof's avatar
Peter van 't Hof committed
44
    val bamMetricsPage = if (summary.getValue(sampleId, libId, "mapping", "settings", "skip_metrics").getOrElse(false) != true) {
45
46
47
48
49
50
51
52
53
54
55
      Some(BammetricsReport.bamMetricsPage(summary, sampleId, libId))
    } else None
    ReportPage((if (skipFlexiprep) Nil else List("QC" -> FlexiprepReport.flexiprepPage)) :::
      bamMetricsPage.map(_.subPages).getOrElse(Nil) ::: List(
        "Versions" -> ReportPage(List(), List("Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
        )), Map()),
        "Files" -> ReportPage(List(), (if (skipFlexiprep) Nil else 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"))) :::
          List("Bam files per lib" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/outputBamfiles.ssp", Map("sampleLevel" -> false))
          ), Map())
56
57
58
59
60
      ) :::
        (if (krakenExecuted) List("Gears - Metagenomics" -> ReportPage(List(), List(
          "Sunburst analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp"
          )), Map()))
        else Nil), List(
61
      "Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/mapping/mappingFront.ssp")
62
    ) ::: bamMetricsPage.map(_.sections).getOrElse(Nil),
63
64
65
66
      Map()
    )
  }
}