Commit 1bed81c6 authored by Peter van 't Hof's avatar Peter van 't Hof

Changed output of stats for coverage stats

parent 48b70e4b
...@@ -156,6 +156,8 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit ...@@ -156,6 +156,8 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit
//FIXME:should use piping //FIXME:should use piping
add(BedtoolsCoverage(this, inputBam, intervals.bed, coverageFile, depth = true), true) add(BedtoolsCoverage(this, inputBam, intervals.bed, coverageFile, depth = true), true)
val covStats = CoverageStats(this, coverageFile, targetDir) val covStats = CoverageStats(this, coverageFile, targetDir)
covStats.title = Some("Coverage for " + targetName)
covStats.subTitle = Some(" ")
add(covStats) add(covStats)
addSummarizable(covStats, "cov_stats") addSummarizable(covStats, "cov_stats")
} }
......
...@@ -318,14 +318,4 @@ if __name__ == '__main__': ...@@ -318,14 +318,4 @@ if __name__ == '__main__':
title=title, out_img=args.plot) title=title, out_img=args.plot)
stats = {'coverage': {k: v.get_quick_stats() for k, v in coverages.items()}} stats = {'coverage': {k: v.get_quick_stats() for k, v in coverages.items()}}
if args.plot is not None: json.dump(stats, sys.stdout, sort_keys=True, indent=4, separators=(',', ': '))
files = {'plot_coverage': { \ No newline at end of file
'path': os.path.abspath(args.plot),
'checksum_sha1': None,
}
}
else:
files = {}
json.dump({'stats': stats, 'files': files}, sys.stdout, sort_keys=True, indent=4,
separators=(',', ': '))
\ No newline at end of file
...@@ -18,6 +18,7 @@ package nl.lumc.sasc.biopet.scripts ...@@ -18,6 +18,7 @@ package nl.lumc.sasc.biopet.scripts
import nl.lumc.sasc.biopet.core.config.Configurable import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.summary.Summarizable import nl.lumc.sasc.biopet.core.summary.Summarizable
import nl.lumc.sasc.biopet.extensions.PythonCommandLineFunction import nl.lumc.sasc.biopet.extensions.PythonCommandLineFunction
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import java.io.File import java.io.File
...@@ -33,14 +34,23 @@ class CoverageStats(val root: Configurable) extends PythonCommandLineFunction wi ...@@ -33,14 +34,23 @@ class CoverageStats(val root: Configurable) extends PythonCommandLineFunction wi
@Output(doc = "plot File (png)") @Output(doc = "plot File (png)")
var plot: File = _ var plot: File = _
var title: Option[String] = None
var subTitle: Option[String] = None
override val defaultCoreMemory = 9.0 override val defaultCoreMemory = 9.0
def cmdLine = getPythonCommand + def cmdLine = getPythonCommand +
required(input) + required("--plot", plot) + " > " + required(output) required(input) +
required("--plot", plot) +
optional("--title", title) +
optional("--subtitle", subTitle) +
" > " + required(output)
def summaryFiles: Map[String, File] = Map("output" -> output, "plot" -> plot) def summaryFiles: Map[String, File] = Map("output" -> output, "plot" -> plot)
def summaryStats: Map[String, Any] = Map() def summaryStats: Map[String, Any] = {
ConfigUtils.fileToConfigMap(output)
}
} }
object CoverageStats { object CoverageStats {
......
...@@ -24,12 +24,12 @@ object ShivaReport extends MultisampleReportBuilder { ...@@ -24,12 +24,12 @@ object ShivaReport extends MultisampleReportBuilder {
val regions = regionsPage val regions = regionsPage
ReportPage( ReportPage(
Map("Samples" -> generateSamplesPage(pageArgs)) ++ Map("Samples" -> generateSamplesPage(pageArgs)) ++
(if (regions.isDefined) Map(regions.get) else Map()) ++ (if (regions.isDefined) Map(regions.get) else Map()) ++
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())
), ),
List( List(
"Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/shivaFront.ssp"), "Report" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/shivaFront.ssp"),
"Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/sampleVariants.ssp", "Variantcalling" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/shiva/sampleVariants.ssp",
......
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