Commit c19baaeb authored by sajvanderzeeuw's avatar sajvanderzeeuw
Browse files

Fix singleSample commandline function

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