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

Rename afterGraph to beforeGraph

parent 21fba762
......@@ -11,8 +11,8 @@ import nl.lumc.sasc.biopet.core.config.Configurable
class ApplyRecalibration(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.ApplyRecalibration with GatkGeneral {
scatterCount = config("scattercount", default = 0)
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
nt = Option(getThreads(3))
memoryLimit = Option(nt.getOrElse(1) * 2)
......
......@@ -22,7 +22,7 @@ object BaseRecalibrator {
val br = new BaseRecalibrator(root)
br.input_file :+= input
br.out = output
br.afterGraph
br.beforeGraph
return br
}
}
\ No newline at end of file
......@@ -35,8 +35,8 @@ class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.qu
stand_emit_conf = config("stand_emit_conf", default = 0)
}
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
if (bamOutput != null && nct.getOrElse(1) > 1) {
threads = 1
logger.warn("BamOutput is on, nct/threads is forced to set on 1, this option is only for debug")
......
......@@ -8,8 +8,8 @@ package nl.lumc.sasc.biopet.extensions.gatk
import nl.lumc.sasc.biopet.core.config.Configurable
class UnifiedGenotyper(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.UnifiedGenotyper with GatkGeneral {
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
genotype_likelihoods_model = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypeLikelihoodsCalculationModel.Model.BOTH
if (config.contains("scattercount")) scatterCount = config("scattercount")
......
......@@ -9,8 +9,8 @@ import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class VariantEval(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.VariantEval with GatkGeneral {
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
}
}
......@@ -21,7 +21,7 @@ object VariantEval {
vareval.eval = Seq(sample)
vareval.comp = Seq(compareWith)
vareval.out = output
vareval.afterGraph
vareval.beforeGraph
return vareval
}
......@@ -35,7 +35,7 @@ object VariantEval {
vareval.ST = ST
vareval.noEV = true
vareval.EV = EV
vareval.afterGraph
vareval.beforeGraph
return vareval
}
......
......@@ -51,15 +51,14 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
* Can overr
* ide this method. This is executed after the script is done en queue starts to generate the graph
*/
protected[core] def afterGraph {}
//TODO: function need rename to beforeGraph
protected[core] def beforeGraph {}
/**
* Set default output file, threads and vmem for current job
*/
override def freezeFieldValues() {
checkExecutable
afterGraph
beforeGraph
if (jobOutputFile == null) jobOutputFile = new File(firstOutput.getParent + "/." + firstOutput.getName + "." + configName + ".out")
if (threads == 0) threads = getThreads(defaultThreads)
......@@ -126,7 +125,7 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
addJobReportBinding("cores", nCoresRequest match {
case Some(n) if n > 0 => n
case _ => 1
case _ => 1
})
addJobReportBinding("version", getVersion)
}
......
......@@ -37,8 +37,8 @@ trait BiopetJavaCommandLineFunction extends JavaCommandLineFunction with BiopetC
/**
* Sets memory limit
*/
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
memoryLimit = config("memory_limit")
}
......
......@@ -72,7 +72,7 @@ trait BiopetQScript extends Configurable with GatkLogging {
for (function <- functions) function match {
case f: BiopetCommandLineFunctionTrait => {
f.checkExecutable
f.afterGraph
f.beforeGraph
f.commandLine
}
case _ =>
......
......@@ -48,7 +48,7 @@ class Fastqc(val root: Configurable) extends BiopetCommandLineFunction {
override def versionCommand = executable + " --version"
override val defaultThreads = 4
override def afterGraph {
override def beforeGraph {
this.checkExecutable
val fastqcDir = new File(executable).getParent
......
......@@ -64,10 +64,10 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction {
var executableNonThreads: String = config("exe", default = "raxmlHPC")
var executableThreads: Option[String] = config("exe_pthreads")
override def afterGraph {
override def beforeGraph {
if (threads == 0) threads = getThreads(defaultThreads)
executable = if (threads > 1 && executableThreads.isDefined) executableThreads.get else executableNonThreads
super.afterGraph
super.beforeGraph
out +:= getInfoFile
f match {
case "d" if b.isEmpty => {
......
......@@ -47,8 +47,8 @@ class RunGubbins(val root: Configurable) extends BiopetCommandLineFunction {
var verbose: Boolean = config("verbose", default = false)
var noCleanup: Boolean = config("no_cleanup", default = false)
override def afterGraph: Unit = {
super.afterGraph
override def beforeGraph: Unit = {
super.beforeGraph
jobLocalDir = new File(outputDirectory)
if (prefix.isEmpty) prefix = Some(fastafile.getName)
val out: List[String] = List(".recombination_predictions.embl",
......
......@@ -53,7 +53,7 @@ class Sickle(val root: Configurable) extends BiopetCommandLineFunction {
override val versionRegex = """sickle version (.*)""".r
override def versionCommand = executable + " --version"
override def afterGraph {
override def beforeGraph {
if (qualityType.isEmpty) qualityType = Some(defaultQualityType)
}
......
......@@ -62,7 +62,7 @@ class Star(val root: Configurable) extends BiopetCommandLineFunction {
override val defaultVmem = "6G"
override val defaultThreads = 8
override def afterGraph() {
override def beforeGraph() {
if (outFileNamePrefix != null && !outFileNamePrefix.endsWith(".")) outFileNamePrefix += "."
val prefix = if (outFileNamePrefix != null) outputDir + outFileNamePrefix else outputDir
if (runmode == null) {
......@@ -103,7 +103,7 @@ object Star {
star.outputDir = outputDir
star.isIntermediate = isIntermediate
star.deps = deps
star.afterGraph
star.beforeGraph
return star
}
......@@ -111,20 +111,20 @@ object Star {
val starCommand_pass1 = Star(configurable, R1, if (R2 != null) R2 else null, new File(outputDir, "aln-pass1"))
starCommand_pass1.isIntermediate = isIntermediate
starCommand_pass1.deps = deps
starCommand_pass1.afterGraph
starCommand_pass1.beforeGraph
val starCommand_reindex = new Star(configurable)
starCommand_reindex.sjdbFileChrStartEnd = starCommand_pass1.outputTab
starCommand_reindex.outputDir = new File(outputDir, "re-index")
starCommand_reindex.runmode = "genomeGenerate"
starCommand_reindex.isIntermediate = isIntermediate
starCommand_reindex.afterGraph
starCommand_reindex.beforeGraph
val starCommand_pass2 = Star(configurable, R1, if (R2 != null) R2 else null, new File(outputDir, "aln-pass2"))
starCommand_pass2.genomeDir = starCommand_reindex.outputDir
starCommand_pass2.isIntermediate = isIntermediate
starCommand_pass2.deps = deps
starCommand_pass2.afterGraph
starCommand_pass2.beforeGraph
return (starCommand_pass2.outputSam, List(starCommand_pass1, starCommand_reindex, starCommand_pass2))
}
......
......@@ -64,7 +64,7 @@ class TopHat(val root: Configurable) extends BiopetCommandLineFunction {
override def versionCommand = executable + " --version"
override def afterGraph() {
override def beforeGraph() {
if (!outputDir.endsWith("/")) outputDir += "/"
output = new File(outputDir + "accepted_hits.bam")
}
......
......@@ -28,7 +28,7 @@ class ConiferExport(val root: Configurable) extends Conifer {
@Output(doc = "Output <sample>.svdzrpkm.bed", shortName = "out", required = true)
var output: File = _
override def afterGraph {
override def beforeGraph {
this.checkExecutable
}
......
......@@ -44,8 +44,8 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
var pairs: Boolean = config("pairs", default = false)
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
if (!input.exists()) throw new FileNotFoundException("Input bam is required for IGVToolsCount")
if (!wig.isEmpty && !wig.get.getAbsolutePath.endsWith(".wig")) throw new IllegalArgumentException("Wiggle file should have a .wig file-extension")
......
......@@ -55,7 +55,7 @@ class Macs2CallPeak(val root: Configurable) extends Macs2 {
var broadcutoff: Option[Int] = config("broadcutoff")
var callsummits: Boolean = config("callsummits", default = false)
override def afterGraph: Unit = {
override def beforeGraph: Unit = {
if (name.isEmpty) throw new IllegalArgumentException("Name is not defined")
if (outputdir == null) throw new IllegalArgumentException("Outputdir is not defined")
output_narrow = new File(outputdir + name.get + ".narrowPeak")
......
......@@ -49,7 +49,7 @@ class CollectGcBiasMetrics(val root: Configurable) extends Picard {
@Argument(doc = "IS_BISULFITE_SEQUENCED", required = false)
var isBisulfiteSequinced: Option[Boolean] = config("isbisulfitesequinced")
override def afterGraph {
override def beforeGraph {
if (outputChart == null) outputChart = new File(output + ".pdf")
//require(reference.exists)
}
......
......@@ -54,7 +54,7 @@ class CollectInsertSizeMetrics(val root: Configurable) extends Picard {
@Argument(doc = "HISTOGRAM_WIDTH", required = false)
var histogramWidth: Option[Int] = config("histogramWidth")
override def afterGraph {
override def beforeGraph {
if (outputHistogram == null) outputHistogram = new File(output + ".pdf")
//require(reference.exists)
}
......
......@@ -70,8 +70,8 @@ class MarkDuplicates(val root: Configurable) extends Picard {
@Output(doc = "Bam Index", required = true)
private var outputIndex: File = _
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
if (createIndex) outputIndex = new File(output.getAbsolutePath.stripSuffix(".bam") + ".bai")
}
......
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