QJobReport is now the official capability name

This commit is contained in:
Mark DePristo 2011-08-24 13:59:14 -04:00
parent d047c19ad1
commit 16d8360592
3 changed files with 19 additions and 15 deletions

View File

@ -115,9 +115,8 @@ class QCommandLine extends CommandLineProgram with Logging {
// walk over each script, calling onExecutionDone // walk over each script, calling onExecutionDone
for (script <- allQScripts) { for (script <- allQScripts) {
script.onExecutionDone(qGraph.getFunctionsAndStatus(script.functions), qGraph.success) script.onExecutionDone(qGraph.getFunctionsAndStatus(script.functions), qGraph.success)
val reportFile = new File("joblogging.gatkreport.txt") logger.info("Writing JobLogging GATKReport to file " + settings.jobReportFile)
logger.info("Writing JobLogging GATKReport to file " + reportFile) QJobReport.printReport(qGraph.getFunctionsAndStatus(script.functions), settings.jobReportFile)
JobLogging.printLogs(qGraph.getFunctionsAndStatus(script.functions), reportFile)
} }
if (!qGraph.success) { if (!qGraph.success) {

View File

@ -69,6 +69,9 @@ class QGraphSettings {
@Argument(fullName="expanded_dot_graph", shortName="expandedDot", doc="Outputs the queue graph of scatter gather to a .dot file. Otherwise overwrites the dot_graph", required=false) @Argument(fullName="expanded_dot_graph", shortName="expandedDot", doc="Outputs the queue graph of scatter gather to a .dot file. Otherwise overwrites the dot_graph", required=false)
var expandedDotFile: File = _ var expandedDotFile: File = _
@Argument(fullName="jobReport", shortName="jobReport", doc="File where we will write the Queue job report", required=false)
var jobReportFile: File = new File("queue_job_report.gatkreport.txt")
@ArgumentCollection @ArgumentCollection
val qSettings = new QSettings val qSettings = new QSettings
} }

View File

@ -32,7 +32,7 @@ import java.io.{FileOutputStream, PrintStream, File}
/** /**
* A mixin to add Job info to the class * A mixin to add Job info to the class
*/ */
trait JobLogging extends QFunction { trait QJobReport extends QFunction {
private var group: String = _ private var group: String = _
private var features: Map[String, String] = null private var features: Map[String, String] = null
@ -70,16 +70,18 @@ trait JobLogging extends QFunction {
} }
} }
object JobLogging { object QJobReport {
def printLogs(jobs: Map[QFunction, JobRunInfo], dest: File) { def printReport(jobs: Map[QFunction, JobRunInfo], dest: File) {
val jobLogs: List[JobLogging] = jobLoggingSublist(jobs.keys.toList) val jobLogs: List[QJobReport] = jobLoggingSublist(jobs.keys.toList)
jobLogs.foreach((job: JobLogging) => job.addRunInfo(jobs.get(job).get)) jobLogs.foreach((job: QJobReport) => job.addRunInfo(jobs.get(job).get))
printJobLogging(jobLogs, new PrintStream(new FileOutputStream(dest))) val stream = new PrintStream(new FileOutputStream(dest))
printJobLogging(jobLogs, stream)
stream.close()
} }
private def jobLoggingSublist(l: List[QFunction]): List[JobLogging] = { private def jobLoggingSublist(l: List[QFunction]): List[QJobReport] = {
def asJogLogging(qf: QFunction): JobLogging = qf match { def asJogLogging(qf: QFunction): QJobReport = qf match {
case x: JobLogging => x case x: QJobReport => x
case _ => null case _ => null
} }
@ -90,7 +92,7 @@ object JobLogging {
* Prints the JobLogging logs to a GATKReport. First splits up the * Prints the JobLogging logs to a GATKReport. First splits up the
* logs by group, and for each group generates a GATKReportTable * logs by group, and for each group generates a GATKReportTable
*/ */
private def printJobLogging(logs: List[JobLogging], stream: PrintStream) { private def printJobLogging(logs: List[QJobReport], stream: PrintStream) {
// create the report // create the report
val report: GATKReport = new GATKReport val report: GATKReport = new GATKReport
@ -112,11 +114,11 @@ object JobLogging {
report.print(stream) report.print(stream)
} }
private def groupLogs(logs: List[JobLogging]): Map[String, List[JobLogging]] = { private def groupLogs(logs: List[QJobReport]): Map[String, List[QJobReport]] = {
logs.groupBy(_.getGroup) logs.groupBy(_.getGroup)
} }
private def logKeys(logs: List[JobLogging]): Set[String] = { private def logKeys(logs: List[QJobReport]): Set[String] = {
// the keys should be the same for each log, but we will check that // the keys should be the same for each log, but we will check that
val keys = Set[String](logs(0).getFeatureNames : _*) val keys = Set[String](logs(0).getFeatureNames : _*)