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

Renaming values

parent 91e72434
......@@ -34,14 +34,14 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
class Sample(sampleId: String) extends AbstractSample(sampleId) {
def makeLibrary(id: String) = new Library(id)
class Library(libraryId: String) extends AbstractLibrary(libraryId) {
def addJobs(): Unit = {}
protected def addLibJobsInternal(): Unit = {}
}
var output: FastaOutput = _
var outputSnps: FastaOutput = _
def addJobs(): Unit = {
runLibraryJobs()
protected def addSampleJobsInternal(): Unit = {
runLibsJobs()
output = addGenerateFasta(sampleId, sampleDir)
outputSnps = addGenerateFasta(sampleId, sampleDir, snpsOnly = true)
}
......@@ -59,7 +59,7 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
val refVariants = addGenerateFasta(null, outputDir + "reference/", outputName = "reference")
val refVariantSnps = addGenerateFasta(null, outputDir + "reference/", outputName = "reference", snpsOnly = true)
runSamplesJobs()
addSamplesJobs()
val catVariants = Cat(this, refVariants.variants :: samples.map(_._2.output.variants).toList, outputDir + "fastas/variant.fasta")
add(catVariants)
......
......@@ -65,7 +65,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
gatkVariantcalling.sampleID = sampleId
gatkVariantcalling.outputDir = libDir
def addJobs(): Unit = {
protected def addLibJobsInternal(): Unit = {
val bamFile: Option[File] = if (config.contains("R1")) {
mapping.input_R1 = config("R1")
mapping.input_R2 = config("R2")
......@@ -137,8 +137,8 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
gatkVariantcalling.sampleID = sampleId
gatkVariantcalling.outputDir = sampleDir + "/variantcalling/"
def addJobs(): Unit = {
runLibraryJobs()
protected def addSampleJobsInternal(): Unit = {
runLibsJobs()
gatkVariantcalling.inputBams = libraries.map(_._2.mapping.finalBamFile).toList
gatkVariantcalling.preProcesBams = false
if (!singleSampleCalling) {
......@@ -162,7 +162,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
}
def biopetScript() {
runSamplesJobs
addSamplesJobs
//SampleWide jobs
val gvcfFiles: List[File] = if (mergeGvcfs && externalGvcfs.size + samples.size > 1) {
......
......@@ -47,10 +47,10 @@ trait MultiSampleQScript extends BiopetQScript {
val config = new ConfigFunctions(defaultSample = sampleId, defaultLibrary = libraryId)
/** Adds the library jobs */
final def add(): Unit = {
final def addLibJobs(): Unit = {
currentSample = Some(sampleId)
currentLib = Some(libraryId)
addJobs()
addLibJobsInternal()
currentLib = None
currentSample = None
}
......@@ -62,7 +62,7 @@ trait MultiSampleQScript extends BiopetQScript {
def libDir = sampleDir + "lib_" + libraryId + File.separator
/** Function that add library jobs */
protected def addJobs()
protected def addLibJobsInternal()
}
/** Library type, need implementation in pipeline */
......@@ -84,19 +84,19 @@ trait MultiSampleQScript extends BiopetQScript {
}
/** Adds sample jobs */
final def add(): Unit = {
final def addSampleJobs(): Unit = {
currentSample = Some(sampleId)
addJobs()
addSampleJobsInternal()
currentSample = None
}
/** Function to add library jobs */
protected def addJobs()
/** Function to add sample jobs */
protected def addSampleJobsInternal()
/** function runs all libraries in one call */
protected final def runLibraryJobs(): Unit = {
protected final def runLibsJobs(): Unit = {
for ((libraryId, library) <- libraries) {
library.add()
library.addLibJobs()
}
}
......@@ -130,9 +130,9 @@ trait MultiSampleQScript extends BiopetQScript {
}
/** Runs runSingleSampleJobs method for each sample */
final def runSamplesJobs() {
final def addSamplesJobs() {
for ((sampleId, sample) <- samples) {
sample.add()
sample.addSampleJobs()
}
}
......
......@@ -27,12 +27,12 @@ class MultisamplePipelineTemplate(val root: Configurable) extends QScript with M
def makeLibrary(id: String) = new Library(id)
class Library(libraryId: String) extends AbstractLibrary(libraryId) {
def addJobs(): Unit = {
protected def addLibJobsInternal(): Unit = {
// Library jobs
}
}
def addJobs(): Unit = {
protected def addSampleJobsInternal(): Unit = {
// Sample jobs
}
}
......
......@@ -39,10 +39,10 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
var skipClip: Boolean = config("skip_clip", default = false)
/** Sample name */
var sampleName: String = _
var sampleId: String = _
/** Library name */
var libraryName: String = _
var libraryId: String = _
var paired: Boolean = (input_R2 != null)
var R1_ext: String = _
......@@ -60,8 +60,8 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
def init() {
if (input_R1 == null) throw new IllegalStateException("Missing R1 on flexiprep module")
if (outputDir == null) throw new IllegalStateException("Missing Output directory on flexiprep module")
if (sampleName == null) throw new IllegalStateException("Missing Sample name on flexiprep module")
if (libraryName == null) throw new IllegalStateException("Missing Library name on flexiprep module")
if (sampleId == null) throw new IllegalStateException("Missing Sample name on flexiprep module")
if (libraryId == null) throw new IllegalStateException("Missing Library name on flexiprep module")
else if (!outputDir.endsWith("/")) outputDir += "/"
paired = (input_R2 != null)
......@@ -79,7 +79,7 @@ class Flexiprep(val root: Configurable) extends QScript with BiopetQScript {
R2_name = R2_name.substring(0, R2_name.lastIndexOf(R2_ext))
}
summary.out = outputDir + sampleName + "-" + libraryName + ".qc.summary.json"
summary.out = outputDir + sampleId + "-" + libraryId + ".qc.summary.json"
}
def biopetScript() {
......
......@@ -120,8 +120,8 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
logger.debug("Start")
md5Summary()
val summary =
("samples" := ( flexiprep.sampleName :=
("libraries" := ( flexiprep.libraryName := (
("samples" := ( flexiprep.sampleId :=
("libraries" := ( flexiprep.libraryId := (
("flexiprep" := (
("clipping" := !flexiprep.skipClip) ->:
("trimming" := !flexiprep.skipTrim) ->:
......
......@@ -126,8 +126,8 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
flexiprep.outputDir = outputDir + "flexiprep/"
flexiprep.input_R1 = input_R1
if (paired) flexiprep.input_R2 = input_R2
flexiprep.sampleName = this.sampleId
flexiprep.libraryName = this.libraryId
flexiprep.sampleId = this.sampleId
flexiprep.libraryId = this.libraryId
flexiprep.init
flexiprep.runInitialJobs
}
......
......@@ -67,14 +67,14 @@ class Sage(val root: Configurable) extends QScript with MultiSampleQScript {
val prefixFastq: File = createFile(".prefix.fastq")
val flexiprep = new Flexiprep(qscript)
flexiprep.sampleName = sampleId
flexiprep.libraryName = libraryId
flexiprep.sampleId = sampleId
flexiprep.libraryId = libraryId
val mapping = new Mapping(qscript)
mapping.libraryId = libraryId
mapping.sampleId = sampleId
def addJobs(): Unit = {
protected def addLibJobsInternal(): Unit = {
flexiprep.outputDir = libDir + "flexiprep/"
flexiprep.input_R1 = inputFastq
flexiprep.init
......@@ -102,8 +102,8 @@ class Sage(val root: Configurable) extends QScript with MultiSampleQScript {
}
}
def addJobs(): Unit = {
runLibraryJobs()
protected def addSampleJobsInternal(): Unit = {
runLibsJobs()
val libraryBamfiles = libraries.map(_._2.mapping.finalBamFile).toList
val libraryFastqFiles = libraries.map(_._2.prefixFastq).toList
......@@ -151,7 +151,7 @@ class Sage(val root: Configurable) extends QScript with MultiSampleQScript {
tagsLibrary = cdl.output
}
runSamplesJobs
addSamplesJobs
}
def addBedtoolsCounts(bamFile: File, outputPrefix: String, outputDir: String) {
......
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