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

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 = ???
......
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