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

Merge branch 'feature-fixSingleSample' into 'develop'

Feature fix single sample

MERGE please!

See merge request !49
parents 4805a430 c19baaeb
......@@ -13,12 +13,11 @@ trait MultiSampleQScript extends BiopetQScript {
def getLibrary(key: String) = libraries(key)
}
var samplesConfig: Map[String, Any] = Map()
var samplesConfig: Map[String, Any] = config("samples")
var samplesOutput: Map[String, SampleOutput] = Map()
def globalSampleDir: String = outputDir + "samples/"
final def runSamplesJobs() {
samplesConfig = config("samples")
if (samplesConfig == null) samplesConfig = Map()
if (Config.global.contains("samples")) for ((key, value) <- samplesConfig) {
var sample = Configurable.any2map(value)
......@@ -32,7 +31,11 @@ trait MultiSampleQScript extends BiopetQScript {
def runSingleSampleJobs(sampleConfig: Map[String, Any]): SampleOutput
def runSingleSampleJobs(sample: String): SampleOutput = {
return runSingleSampleJobs(Configurable.any2map(samplesConfig(sample)))
var map = Configurable.any2map(samplesConfig(sample))
if (map.contains("ID") && map("ID") != sample)
throw new IllegalStateException("ID in config not the same as the key")
else map += ("ID" -> sample)
return runSingleSampleJobs(map)
}
final def runLibraryJobs(sampleConfig: Map[String, Any]): Map[String, LibraryOutput] = {
......
......@@ -18,7 +18,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
def this() = this(null)
@Argument(doc = "Only Sample", shortName = "sample", required = false)
val onlySample: String = ""
val onlySample: List[String] = Nil
@Argument(doc = "Skip Genotyping step", shortName = "skipgenotyping", required = false)
var skipGenotyping: Boolean = false
......@@ -115,7 +115,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
recalibration.biopetScript
}
}
} else runSingleSampleJobs(onlySample)
} else for (sample <- onlySample) runSingleSampleJobs(sample)
}
// Called for each sample
......
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