Commit bf7a1163 authored by Peter van 't Hof's avatar Peter van 't Hof

Split read and write methods to another class, multi threaded reading enabled for report

parent 0d9298f4
...@@ -164,7 +164,7 @@ trait ReportBuilder extends ToolCommand { ...@@ -164,7 +164,7 @@ trait ReportBuilder extends ToolCommand {
require(cmdArgs.outputDir.exists(), "Output dir does not exist") require(cmdArgs.outputDir.exists(), "Output dir does not exist")
require(cmdArgs.outputDir.isDirectory, "Output dir is not a directory") require(cmdArgs.outputDir.isDirectory, "Output dir is not a directory")
setSummary = SummaryDb.openSqliteSummary(cmdArgs.summaryDbFile) setSummary = SummaryDb.openReadOnlySqliteSummary(cmdArgs.summaryDbFile)
setRunId = cmdArgs.runId setRunId = cmdArgs.runId
cmdArgs.pageArgs.get("sampleId") match { cmdArgs.pageArgs.get("sampleId") match {
......
...@@ -14,15 +14,14 @@ ...@@ -14,15 +14,14 @@
*/ */
package nl.lumc.sasc.biopet.core.summary package nl.lumc.sasc.biopet.core.summary
import java.io.{ File, PrintWriter } import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core._ import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.utils.ConfigUtils import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.LastCommitHash import nl.lumc.sasc.biopet.utils.summary.db.{ SummaryDb, SummaryDbWrite }
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import org.broadinstitute.gatk.queue.function.{ InProcessFunction, QFunction } import org.broadinstitute.gatk.queue.function.{ InProcessFunction, QFunction }
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.Input
import scala.collection.mutable import scala.collection.mutable
import scala.io.Source import scala.io.Source
...@@ -215,7 +214,7 @@ object WriteSummary { ...@@ -215,7 +214,7 @@ object WriteSummary {
Source.fromFile(checksumFile).getLines().toList.head.split(" ")(0) Source.fromFile(checksumFile).getLines().toList.head.split(" ")(0)
} }
def createFile(db: SummaryDb, runId: Int, pipelineId: Int, moduleId: Option[Int], sampleId: Option[Int], libId: Option[Int], key: String, file: File, outputDir: File) = { def createFile(db: SummaryDbWrite, runId: Int, pipelineId: Int, moduleId: Option[Int], sampleId: Option[Int], libId: Option[Int], key: String, file: File, outputDir: File) = {
val path = if (file.getAbsolutePath.startsWith(outputDir.getAbsolutePath + File.separator)) { val path = if (file.getAbsolutePath.startsWith(outputDir.getAbsolutePath + File.separator)) {
"." + file.getAbsolutePath.stripPrefix(s"${outputDir.getAbsolutePath}") "." + file.getAbsolutePath.stripPrefix(s"${outputDir.getAbsolutePath}")
} else file.getAbsolutePath } else file.getAbsolutePath
......
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