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

Rename root to parent

parent 463f8002
......@@ -27,7 +27,7 @@ import org.broadinstitute.gatk.queue.QScript
*
* Created by pjvan_thof on 1/29/15.
*/
class Bam2Wig(val root: Configurable) extends QScript with BiopetQScript {
class Bam2Wig(val parent: Configurable) extends QScript with BiopetQScript {
def this() = this(null)
@Input(doc = "Input bam file", required = true)
......
......@@ -28,7 +28,7 @@ import scala.collection.JavaConversions._
*
* Created by pjvan_thof on 1/29/15.
*/
class BamToChromSizes(val root: Configurable) extends InProcessFunction with Configurable {
class BamToChromSizes(val parent: Configurable) extends InProcessFunction with Configurable {
@Input
var bamFile: File = _
......
......@@ -28,7 +28,7 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.utils.intervals.BedCheck
import org.broadinstitute.gatk.queue.QScript
class BamMetrics(val root: Configurable) extends QScript
class BamMetrics(val parent: Configurable) extends QScript
with SummaryQScript
with SampleLibraryTag
with Reference
......
......@@ -21,7 +21,7 @@ import nl.lumc.sasc.biopet.core.report.{ ReportBuilderExtension, ReportBuilder,
import nl.lumc.sasc.biopet.utils.summary.{ Summary, SummaryValue }
import nl.lumc.sasc.biopet.utils.rscript.{ StackedBarPlot, LinePlot }
class BammetricsReport(val root: Configurable) extends ReportBuilderExtension {
class BammetricsReport(val parent: Configurable) extends ReportBuilderExtension {
def builder = BammetricsReport
}
......
......@@ -22,7 +22,7 @@ import nl.lumc.sasc.biopet.core.summary.Summarizable
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
class CoverageStats(val root: Configurable) extends PythonCommandLineFunction with Summarizable {
class CoverageStats(val parent: Configurable) extends PythonCommandLineFunction with Summarizable {
setPythonScript("bedtools_cov_stats.py")
@Input(doc = "Input file", required = false)
......
......@@ -28,7 +28,7 @@ import nl.lumc.sasc.biopet.extensions.tools.BastyGenerateFasta
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
class Basty(val parent: Configurable) extends QScript with MultiSampleQScript {
qscript =>
def this() = this(null)
......
......@@ -22,7 +22,7 @@ import org.broadinstitute.gatk.utils.commandline.Output
/**
* Created by pjvan_thof on 9/29/15.
*/
class BiopetFifoPipe(val root: Configurable,
class BiopetFifoPipe(val parent: Configurable,
protected var commands: List[BiopetCommandLineFunction]) extends BiopetCommandLineFunction {
def fifos: List[File] = {
......
......@@ -72,7 +72,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
override def defaultCoreMemory = 0.0
override def defaultThreads = 0
val root: Configurable = commands.head.root
val parent: Configurable = commands.head.parent
override def configNamespace = commands.map(_.configNamespace).mkString("-")
def cmdLine: String = {
"(" + commands.head.cmdLine + (if (commands.head.stdinFile.isDefined) {
......
......@@ -33,7 +33,7 @@ trait Reference extends Configurable {
/** Returns species, default to unknown_species */
def referenceSpecies: String = {
root match {
parent match {
case r: Reference if r.referenceSpecies != "unknown_species" => r.referenceSpecies
case _ => config("species", default = "unknown_species", path = super.configPath)
}
......@@ -41,7 +41,7 @@ trait Reference extends Configurable {
/** Return referencename, default to unknown_ref */
def referenceName: String = {
root match {
parent match {
case r: Reference if r.referenceName != "unknown_ref" => r.referenceName
case _ =>
val default: String = config("default", default = "unknown_ref", path = List("references", referenceSpecies))
......
......@@ -27,13 +27,13 @@ trait SampleLibraryTag extends Configurable {
//FIXME: not possible to have required sample / lib
@Argument(doc = "Sample ID", shortName = "sample", required = false)
var sampleId: Option[String] = root match {
var sampleId: Option[String] = parent match {
case tag: SampleLibraryTag => tag.sampleId
case _ => None
}
@Argument(doc = "Library ID", shortName = "library", required = false)
var libId: Option[String] = root match {
var libId: Option[String] = parent match {
case tag: SampleLibraryTag => tag.libId
case _ => None
}
......
......@@ -30,7 +30,7 @@ import scala.collection.mutable.ListBuffer
* @author Peter van 't Hof <p.j.van_t_hof@lumc.nl>
*/
object WriteDependencies extends Logging with Configurable {
val root: Configurable = null
val parent: Configurable = null
private def createFunctionNames(functions: Seq[QFunction]): Map[QFunction, String] = {
val cache: mutable.Map[String, Int] = mutable.Map()
(for (function <- functions) yield {
......@@ -113,7 +113,7 @@ object WriteDependencies extends Logging with Configurable {
case _ => None
}), "main_job" -> (f match {
case cmd: BiopetCommandLineFunction => cmd.mainFunction
case s: WriteSummary if s.qscript.root == null => true
case s: WriteSummary if s.qscript.parent == null => true
case _ => false
}), "intermediate" -> f.isIntermediate,
"depends_on_intermediate" -> BiopetQScript.safeInputs(f).getOrElse(Seq()).exists(files(_).isIntermediate),
......
......@@ -21,7 +21,7 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/** Extension for md5sum */
class Md5sum(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Md5sum(val parent: Configurable) extends BiopetCommandLineFunction with Version {
mainFunction = false
@Input(doc = "Input")
......
......@@ -31,13 +31,13 @@ import scala.io.Source
*
* Created by pjvan_thof on 2/14/15.
*/
class WriteSummary(val root: Configurable) extends InProcessFunction with Configurable {
class WriteSummary(val parent: Configurable) extends InProcessFunction with Configurable {
this.analysisName = getClass.getSimpleName
require(root.isInstanceOf[SummaryQScript], "root is not a SummaryQScript")
require(parent.isInstanceOf[SummaryQScript], "root is not a SummaryQScript")
/** To access qscript for this summary */
val qscript = root.asInstanceOf[SummaryQScript]
val qscript = parent.asInstanceOf[SummaryQScript]
@Input(doc = "deps", required = false)
var deps: List[File] = Nil
......
......@@ -23,14 +23,14 @@ import org.testng.annotations.Test
*/
class BiopetPipeTest extends TestNGSuite with Matchers {
class Pipe1 extends BiopetCommandLineFunction {
val root = null
val parent = null
def cmdLine = "pipe1" +
(if (!inputAsStdin) " input1 " else "") +
(if (!outputAsStsout) " output1 " + "")
}
class Pipe2 extends BiopetCommandLineFunction {
val root = null
val parent = null
def cmdLine = "pipe2" +
(if (!inputAsStdin) " input2 " else "") +
(if (!outputAsStsout) " output2 " + "")
......
......@@ -28,7 +28,7 @@ class CommandLineResourcesTest extends TestNGSuite with Matchers {
class CommandLineFunctionMock(c: Map[String, Any] = Map()) extends CommandLineFunction with Configurable {
override def freezeFieldValues() {}
def commandLine = "command"
val root = null
val parent = null
override def globalConfig = new Config(c)
}
......
......@@ -214,7 +214,7 @@ object MultiSampleQScriptTest {
override def globalConfig = new Config(configs
.foldLeft(Map[String, Any]()) { case (a, b) => ConfigUtils.mergeMaps(a, b) })
val root = null
val parent = null
def getLastLogMessage: String = {
Logging.errors.toList.last.getMessage
......
......@@ -105,7 +105,7 @@ object ReferenceTest {
r: Configurable = null,
fai: Boolean = false,
dict: Boolean = false) = new Reference {
val root = r
val parent = r
override def globalConfig = new Config(configs
.foldLeft(Map[String, Any]()) { case (a, b) => ConfigUtils.mergeMaps(a, b) })
override def dictRequired = if (dict) true else super.dictRequired
......
......@@ -26,7 +26,7 @@ class SampleLibraryTagTest extends TestNGSuite with Matchers {
@Test
def testDefault: Unit = {
val o = new SampleLibraryTag {
override def root: Configurable = null
override def parent: Configurable = null
override def globalConfig = new Config(Map())
}
o.sampleId shouldBe None
......@@ -36,7 +36,7 @@ class SampleLibraryTagTest extends TestNGSuite with Matchers {
@Test
def testInherit: Unit = {
val o1 = new SampleLibraryTag {
override def root: Configurable = null
override def parent: Configurable = null
override def globalConfig = new Config(Map())
}
o1.sampleId = Some("sampleName")
......@@ -45,7 +45,7 @@ class SampleLibraryTagTest extends TestNGSuite with Matchers {
o1.libId shouldBe Some("libName")
val o2 = new SampleLibraryTag {
override def root: Configurable = o1
override def parent: Configurable = o1
override def globalConfig = new Config(Map())
}
o2.sampleId shouldBe o1.sampleId
......
......@@ -26,7 +26,7 @@ class ToolCommandTest extends TestNGSuite with Matchers {
@Test
def testToolCommand: Unit = {
val tool = new ToolCommandFunction {
def root = null
def parent = null
def toolObject = ToolCommandTest
}
......
......@@ -78,7 +78,7 @@ class AnnotationTest extends TestNGSuite with Matchers {
object AnnotationTest {
class Script(c: Map[String, Any]) extends QScript with BiopetQScript {
override def globalConfig: Config = new Config(c)
val root = null
val parent = null
/** Init for pipeline */
def init(): Unit = ???
......
......@@ -130,7 +130,7 @@ object SummaryQScriptTest {
def summaryFile: File = tempFile
def init(): Unit = ???
def biopetScript(): Unit = ???
def root: Configurable = null
def parent: Configurable = null
}
def makeSummarizable(files: Map[String, File] = Map(), stats: Map[String, Any] = Map()) = new Summarizable {
......
......@@ -238,7 +238,7 @@ object WriteSummaryTest {
def summaryFile: File = tempFile
def init(): Unit = {}
def biopetScript(): Unit = {}
def root: Configurable = null
def parent: Configurable = null
}
def makeSampleLibraryQscript(name: String,
......@@ -260,7 +260,7 @@ object WriteSummaryTest {
def summaryFile: File = tempFile
def init(): Unit = {}
def biopetScript(): Unit = {}
def root: Configurable = null
def parent: Configurable = null
}
def makeMultisampleQscript(name: String,
......@@ -278,7 +278,7 @@ object WriteSummaryTest {
def summaryFile: File = tempFile
def init(): Unit = {}
def biopetScript(): Unit = {}
def root: Configurable = null
def parent: Configurable = null
class Sample(id: String) extends AbstractSample(id) {
class Library(id: String) extends AbstractLibrary(id) {
......@@ -310,7 +310,7 @@ object WriteSummaryTest {
c: Map[String, Any] = Map()) = new BiopetJavaCommandLineFunction with Summarizable with Version {
override def globalConfig = new Config(c)
override def configNamespace = "java_command"
def root: Configurable = null
def parent: Configurable = null
def summaryStats: Map[String, Any] = stats
def summaryFiles: Map[String, File] = files
......@@ -335,7 +335,7 @@ object WriteSummaryTest {
new CommandLineFunction with Configurable with Summarizable with Version {
override def globalConfig = new Config(c)
override def configNamespace = "version_command"
def root: Configurable = null
def parent: Configurable = null
def summaryFiles: Map[String, File] = files
def summaryStats: Any = stats
......
......@@ -25,7 +25,7 @@ import scala.util.matching.Regex
/**
* Created by pjvan_thof on 17-5-16.
*/
class Awk(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Awk(val parent: Configurable) extends BiopetCommandLineFunction with Version {
executable = config("exe", default = "awk", freeVar = false)
def versionCommand: String = executable + " --version"
......
......@@ -22,7 +22,7 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/** Wrapper for the bgzip command */
class Bgzip(val root: Configurable) extends BiopetCommandLineFunction {
class Bgzip(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input files", required = false)
var input: List[File] = Nil
......
......@@ -23,7 +23,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Extension for GNU cat
*/
class Cat(val root: Configurable) extends BiopetCommandLineFunction {
class Cat(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input file", required = true)
var input: List[File] = Nil
......
......@@ -27,7 +27,7 @@ import nl.lumc.sasc.biopet.utils.getSemanticVersion
* Wrapper for the Cnmops command line tool.
* Written based on Cnmops version v2.2.1.
*/
class Cnmops(val root: Configurable) extends RscriptCommandLineFunction with Version {
class Cnmops(val parent: Configurable) extends RscriptCommandLineFunction with Version {
override def defaultThreads = 4
override def defaultCoreMemory: Double = 4.0
......
......@@ -24,7 +24,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
* Wrapper for the cufflinks command line tool.
* Written based on cufflinks version v2.2.1 (md5: 07c831c4f8b4e161882731ea5694ff80)
*/
class Cufflinks(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Cufflinks(val parent: Configurable) extends BiopetCommandLineFunction with Version {
/** default executable */
executable = config("exe", default = "cufflinks")
......
......@@ -24,7 +24,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
* Wrapper for the cuffquant command line tool.
* Written based on cuffquant version v2.2.1 (md5: 0765b82b11db9256f5be341a7da884d6)
*/
class Cuffquant(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Cuffquant(val parent: Configurable) extends BiopetCommandLineFunction with Version {
/** default executable */
executable = config("exe", default = "cuffquant")
......
......@@ -23,7 +23,7 @@ import org.broadinstitute.gatk.utils.commandline.Output
/**
* Created by pjvan_thof on 8/11/15.
*/
class Curl(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Curl(val parent: Configurable) extends BiopetCommandLineFunction with Version {
@Output
var output: File = _
......
......@@ -30,7 +30,7 @@ import scala.util.matching.Regex
* Started with version 1.5
* Updated to version 1.9 (18-01-2016 by wyleung)
*/
class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction with Summarizable with Version {
class Cutadapt(val parent: Configurable) extends BiopetCommandLineFunction with Summarizable with Version {
@Input(doc = "Input fastq file")
var fastqInput: File = _
......
......@@ -24,7 +24,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
* Extension for fastqc
* Based on version 0.10.1 and 0.11.2
*/
class Fastqc(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Fastqc(val parent: Configurable) extends BiopetCommandLineFunction with Version {
@Input(doc = "Contaminants", required = false)
var contaminants: Option[File] = None
......
......@@ -25,7 +25,7 @@ import scala.util.matching.Regex
/**
* Created by pjvanthof on 16/12/15.
*/
class Flash(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Flash(val parent: Configurable) extends BiopetCommandLineFunction with Version {
executable = config("exe", default = "flash", freeVar = false)
/** Command to get version of executable */
......
......@@ -25,7 +25,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
*
* Created by pjvan_thof on 3/3/15.
*/
class Freebayes(val root: Configurable) extends BiopetCommandLineFunction with Reference with Version {
class Freebayes(val parent: Configurable) extends BiopetCommandLineFunction with Reference with Version {
@Input(required = true)
var bamfiles: List[File] = Nil
......
......@@ -23,7 +23,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Created by pjvanthof on 20/06/16.
*/
class GffRead(val root: Configurable) extends BiopetCommandLineFunction {
class GffRead(val parent: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "gffread", freeVar = false)
......
......@@ -23,7 +23,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Created by pjvanthof on 30/03/16.
*/
class Grep(val root: Configurable) extends BiopetCommandLineFunction {
class Grep(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input file", required = true)
var input: File = _
......
......@@ -23,7 +23,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Created by pjvan_thof on 17-5-16.
*/
class GtfToGenePred(val root: Configurable) extends BiopetCommandLineFunction {
class GtfToGenePred(val parent: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "gtfToGenePred", freeVar = false)
@Input
......
......@@ -20,7 +20,7 @@ import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
class Gzip(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Gzip(val parent: Configurable) extends BiopetCommandLineFunction with Version {
@Input(doc = "Input file", required = true)
var input: List[File] = Nil
......
......@@ -24,7 +24,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
* Wrapper for the htseq-count command line tool
* Written based on htseq-count version 0.6.1p1
*/
class HtseqCount(val root: Configurable) extends BiopetCommandLineFunction with Version {
class HtseqCount(val parent: Configurable) extends BiopetCommandLineFunction with Version {
/** default executable */
executable = config("exe", default = "htseq-count")
......
......@@ -25,7 +25,7 @@ import scala.sys.process.{ Process, ProcessLogger }
/**
* This class can execute ln as InProcessFunction or used to only generate the ln command
*/
class Ln(val root: Configurable) extends InProcessFunction with Configurable {
class Ln(val parent: Configurable) extends InProcessFunction with Configurable {
this.analysisName = getClass.getSimpleName
@Input(doc = "Input file")
......
......@@ -21,7 +21,7 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/** Extension for pbzip2 */
class Pbzip2(val root: Configurable) extends BiopetCommandLineFunction {
class Pbzip2(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Zipped file")
var input: File = _
......
......@@ -24,7 +24,7 @@ import org.broadinstitute.gatk.utils.commandline._
/**
* Created by wyleung on 8-1-16.
*/
class Pysvtools(val root: Configurable) extends BiopetCommandLineFunction {
class Pysvtools(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input file", required = true)
var input: List[File] = Nil
......
......@@ -26,7 +26,7 @@ import scalaz.std.boolean.option
* extension for raxml
* based on version 8.1.3
*/
class Raxml(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Raxml(val parent: Configurable) extends BiopetCommandLineFunction with Version {
override def defaultThreads = 1
def versionCommand = executable + " -v"
......
......@@ -25,7 +25,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
* See; https://github.com/sanger-pathogens/gubbins
* No version known
*/
class RunGubbins(val root: Configurable) extends BiopetCommandLineFunction {
class RunGubbins(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Contaminants", required = false)
var startingTree: Option[File] = config("starting_tree")
......
......@@ -25,7 +25,7 @@ import scala.util.matching.Regex
/**
* Created by pjvanthof on 18/05/16.
*/
class Sed(val root: Configurable) extends BiopetCommandLineFunction with Version {
class Sed(val parent: Configurable) extends BiopetCommandLineFunction with Version {
executable = config("exe", default = "sed", freeVar = false)
/** Command to get version of executable */
......
......@@ -21,7 +21,7 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/** Extension for sha1sum */
class Sha1sum(val root: Configurable) extends BiopetCommandLineFunction {
class Sha1sum(val parent: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input file")
var input: File = _
......