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

Rename function

parent 66bebf8a
......@@ -28,10 +28,10 @@ trait MultiSampleQScript extends BiopetQScript {
if (!Config.global.map.contains("samples")) logger.warn("No Samples found in config")
abstract class AbstractSample(val sampleId: String) {
val config = new ConfigFunctions(defaultSample = Some(sampleId))
val config = new ConfigFunctions(defaultSample = sampleId)
abstract class AbstractLibrary(val libraryId: String) {
val config = new ConfigFunctions(defaultSample = Some(sampleId), defaultLibrary = Some(libraryId))
val config = new ConfigFunctions(defaultSample = sampleId, defaultLibrary = libraryId)
final def run(): Unit = {
currentSample = Some(sampleId)
currentLibrary = Some(libraryId)
......@@ -41,7 +41,7 @@ trait MultiSampleQScript extends BiopetQScript {
}
def getLibraryDir: String = {
getSampleDir + "libraries" + File.pathSeparator + libraryId + File.pathSeparator
getSampleDir + "lib_" + libraryId + File.separator
}
protected def runJobs()
......@@ -49,9 +49,9 @@ trait MultiSampleQScript extends BiopetQScript {
type Library <: AbstractLibrary
val libraries: Map[String, Library] = getLibrariesIds.map(id => id -> initLibrary(id)).toMap
val libraries: Map[String, Library] = getLibrariesIds.map(id => id -> makeLibrary(id)).toMap
def initLibrary(id: String): Library
def makeLibrary(id: String): Library
protected def getLibrariesIds: Set[String] = {
ConfigUtils.getMapFromPath(Config.global.map, List("samples", sampleId, "libraries")).getOrElse(Map()).keySet
......@@ -78,9 +78,9 @@ trait MultiSampleQScript extends BiopetQScript {
type Sample <: AbstractSample
def initSample(id: String): Sample
def makeSample(id: String): Sample
val samples: Map[String, Sample] = getSamplesIds.map(id => id -> initSample(id)).toMap
val samples: Map[String, Sample] = getSamplesIds.map(id => id -> makeSample(id)).toMap
/** Returns a list of all sampleIDs */
protected def getSamplesIds: Set[String] = if (onlySample != Nil) onlySample.toSet else {
......
......@@ -22,10 +22,10 @@ import org.broadinstitute.gatk.queue.QScript
class MultisamplePipelineTemplate(val root: Configurable) extends QScript with MultiSampleQScript {
def this() = this(null)
def initSample(id: String) = new Sample(id)
def makeSample(id: String) = new Sample(id)
class Sample(sampleId: String) extends AbstractSample(sampleId) {
def initLibrary(id: String) = new Library(id)
def makeLibrary(id: String) = new Library(id)
class Library(libraryId: String) extends AbstractLibrary(libraryId) {
def runJobs(): Unit = {
// Library jobs
......
Supports Markdown
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