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

Fix missing name refactorings

parent c2ef1e2e
......@@ -265,8 +265,8 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
def summaryStats: Map[String, Any] = {
if (statsText) {
val stats_file: File = new File(output.getAbsolutePath + "_summary.txt")
parseStatsFile(stats_file)
val statsFile: File = new File(output.getAbsolutePath + "_summary.txt")
parseStatsFile(statsFile)
} else {
Map()
}
......
......@@ -102,85 +102,45 @@ class VcfFilterTest extends TestNGSuite with Matchers {
val command = cmd(vcfFilter.cmdLine)
var cmdString: List[String] = Nil
if (minSampleDepth.isDefined) {
cmdString = "--minSampleDepth " + minSampleDepth.getOrElse("") :: cmdString
}
if (minSampleDepth.isDefined) cmdString = "--minSampleDepth " + minSampleDepth.getOrElse("") :: cmdString
if (minTotalDepth.isDefined) {
cmdString = "--minTotalDepth " + minTotalDepth.getOrElse("") :: cmdString
}
if (minTotalDepth.isDefined) cmdString = "--minTotalDepth " + minTotalDepth.getOrElse("") :: cmdString
if (minAlternateDepth.isDefined) {
cmdString = "--minAlternateDepth " + minAlternateDepth.getOrElse("") :: cmdString
}
if (minAlternateDepth.isDefined) cmdString = "--minAlternateDepth " + minAlternateDepth.getOrElse("") :: cmdString
if (minSamplesPass.isDefined) {
cmdString = "--minSamplesPass " + minSamplesPass.getOrElse("") :: cmdString
}
if (minSamplesPass.isDefined) cmdString = "--minSamplesPass " + minSamplesPass.getOrElse("") :: cmdString
if (minGenomeQuality.isDefined) {
cmdString = "--minGenomeQuality " + minGenomeQuality.getOrElse("") :: cmdString
}
if (minGenomeQuality.isDefined) cmdString = "--minGenomeQuality " + minGenomeQuality.getOrElse("") :: cmdString
if (filterRefCalls) {
cmdString = "--filterRefCalls" :: cmdString
}
if (filterRefCalls) cmdString = "--filterRefCalls" :: cmdString
if (invertedOutputVcf.isDefined) {
cmdString = "--invertedOutputVcf " + invertedOutputVcf.getOrElse(new File("")).getAbsolutePath :: cmdString
}
if (invertedOutputVcf.isDefined) cmdString = "--invertedOutputVcf " + invertedOutputVcf.getOrElse(new File("")).getAbsolutePath :: cmdString
if (resToDom.isDefined) {
cmdString = "--resToDom " + resToDom.getOrElse("") :: cmdString
}
if (resToDom.isDefined) cmdString = "--resToDom " + resToDom.getOrElse("") :: cmdString
if (trioCompound.isDefined) {
cmdString = "--trioCompound " + trioCompound.getOrElse("") :: cmdString
}
if (trioCompound.isDefined) cmdString = "--trioCompound " + trioCompound.getOrElse("") :: cmdString
if (deNovoInSample.isDefined) {
cmdString = "--deNovoInSample " + deNovoInSample.getOrElse("") :: cmdString
}
if (deNovoInSample.isDefined) cmdString = "--deNovoInSample " + deNovoInSample.getOrElse("") :: cmdString
if (deNovoTrio.isDefined) {
cmdString = "--deNovoTrio " + deNovoTrio.getOrElse("") :: cmdString
}
if (deNovoTrio.isDefined) cmdString = "--deNovoTrio " + deNovoTrio.getOrElse("") :: cmdString
if (trioLossOfHet.isDefined) {
cmdString = "--trioLossOfHet " + trioLossOfHet.getOrElse("") :: cmdString
}
if (trioLossOfHet.isDefined) cmdString = "--trioLossOfHet " + trioLossOfHet.getOrElse("") :: cmdString
if (mustHaveVariant.nonEmpty) {
cmdString = mustHaveVariant.map(x => "--mustHaveVariant " + x) ::: cmdString
}
if (mustHaveVariant.nonEmpty) cmdString = mustHaveVariant.map(x => "--mustHaveVariant " + x) ::: cmdString
if (calledIn.nonEmpty) {
cmdString = calledIn.map(x => "--calledIn " + x) ::: cmdString
}
if (calledIn.nonEmpty) cmdString = calledIn.map(x => "--calledIn " + x) ::: cmdString
if (mustHaveGenotype.nonEmpty) {
cmdString = mustHaveGenotype.map(x => "--mustHaveGenotype " + x) ::: cmdString
}
if (mustHaveGenotype.nonEmpty) cmdString = mustHaveGenotype.map(x => "--mustHaveGenotype " + x) ::: cmdString
if (diffGenotype.nonEmpty) {
cmdString = diffGenotype.map(x => "--diffGenotype " + x) ::: cmdString
}
if (diffGenotype.nonEmpty) cmdString = diffGenotype.map(x => "--diffGenotype " + x) ::: cmdString
if (filterHetVarToHomVar.nonEmpty) {
cmdString = filterHetVarToHomVar.map(x => "--filterHetVarToHomVar " + x) ::: cmdString
}
if (filterHetVarToHomVar.nonEmpty) cmdString = filterHetVarToHomVar.map(x => "--filterHetVarToHomVar " + x) ::: cmdString
if (id.nonEmpty) {
cmdString = id.map(x => "--id " + x) ::: cmdString
}
if (id.nonEmpty) cmdString = id.map(x => "--id " + x) ::: cmdString
if (idFile.isDefined) {
cmdString = "--idFile " + idFile.getOrElse(new File("")).getAbsolutePath :: cmdString
}
if (idFile.isDefined) cmdString = "--idFile " + idFile.getOrElse(new File("")).getAbsolutePath :: cmdString
if (minQualScore.isDefined) {
cmdString = "--minQualScore " + minQualScore.getOrElse("") :: cmdString
}
if (minQualScore.isDefined) cmdString = "--minQualScore " + minQualScore.getOrElse("") :: cmdString
cmdString.foreach(x => command.contains(x) shouldBe true)
}
......
......@@ -34,25 +34,25 @@ class AnnotateVcfWithBedTest extends TestNGSuite with MockitoSugar with Matchers
Paths.get(getClass.getResource(p).toURI).toString
}
val vepped_path = resourcePath("/VEP_oneline.vcf")
val veppedPath = resourcePath("/VEP_oneline.vcf")
val bed = resourcePath("/rrna01.bed")
val rand = new Random()
@Test def testOutputTypeVcf() = {
val tmpPath = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf"
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmpPath, "-B", bed, "-f", "testing")
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath, "-B", bed, "-f", "testing")
main(arguments)
}
@Test def testOutputTypeBcf() = {
val tmpPath = "/tmp/VcfFilter_" + rand.nextString(10) + ".bcf"
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmpPath, "-B", bed, "-f", "testing")
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath, "-B", bed, "-f", "testing")
main(arguments)
}
@Test def testOutputTypeVcfGz() = {
val tmpPath = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf.gz"
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmpPath, "-B", bed, "-f", "testing")
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath, "-B", bed, "-f", "testing")
main(arguments)
}
......
......@@ -37,7 +37,7 @@ class MergeAllelesTest extends TestNGSuite with MockitoSugar with Matchers {
Paths.get(getClass.getResource(p).toURI).toString
}
val vepped_path = resourcePath("/chrQ.vcf.gz")
val veppedPath = resourcePath("/chrQ.vcf.gz")
val reference = resourcePath("/fake_chrQ.fa")
// These two have to created
......@@ -52,7 +52,7 @@ class MergeAllelesTest extends TestNGSuite with MockitoSugar with Matchers {
val tmp = File.createTempFile("MergeAlleles", ".vcf")
tmp.deleteOnExit()
val tmpPath = tmp.getAbsolutePath
val arguments = Array("-I", vepped_path, "-o", tmpPath, "-R", reference)
val arguments = Array("-I", veppedPath, "-o", tmpPath, "-R", reference)
main(arguments)
}
......@@ -60,7 +60,7 @@ class MergeAllelesTest extends TestNGSuite with MockitoSugar with Matchers {
val tmp = File.createTempFile("MergeAlleles", ".vcf.gz")
tmp.deleteOnExit()
val tmpPath = tmp.getAbsolutePath
val arguments = Array("-I", vepped_path, "-o", tmpPath, "-R", reference)
val arguments = Array("-I", veppedPath, "-o", tmpPath, "-R", reference)
main(arguments)
}
......@@ -68,7 +68,7 @@ class MergeAllelesTest extends TestNGSuite with MockitoSugar with Matchers {
val tmp = File.createTempFile("MergeAlleles", ".bcf")
tmp.deleteOnExit()
val tmpPath = tmp.getAbsolutePath
val arguments = Array("-I", vepped_path, "-o", tmpPath, "-R", reference)
val arguments = Array("-I", veppedPath, "-o", tmpPath, "-R", reference)
main(arguments)
}
}
......@@ -39,31 +39,31 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
Paths.get(getClass.getResource(p).toURI).toString
}
val vepped_path = resourcePath("/VEP_oneline.vcf")
val vepped = new File(vepped_path)
val veppedPath = resourcePath("/VEP_oneline.vcf")
val vepped = new File(veppedPath)
val rand = new Random()
@Test def testOutputTypeVcf() = {
val tmp = File.createTempFile("VcfFilter", ".vcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path)
val tmpPath = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath)
main(arguments)
}
@Test def testOutputTypeBcf() = {
val tmp = File.createTempFile("VcfFilter", ".bcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path)
val tmpPath = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath)
main(arguments)
}
@Test def testOutputTypeVcfGz() = {
val tmp = File.createTempFile("VcfFilter", ".vcf.gz")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path)
val tmpPath = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath)
main(arguments)
}
......@@ -73,22 +73,22 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
*/
val tmp = File.createTempFile("VCfFilter", ".vcf.gz")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path,
val tmpPath = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath,
"--mustHaveGenotype", "Sample_101:HET")
main(arguments)
val size = new VCFFileReader(new File(tmp_path), false).size
val size = new VCFFileReader(new File(tmpPath), false).size
size shouldBe 1
val tmp2 = File.createTempFile("VcfFilter", ".vcf.gz")
tmp2.deleteOnExit()
val tmp2_path = tmp2.getAbsolutePath
val arguments2: Array[String] = Array("-I", vepped_path, "-o", tmp2_path,
val tmpPath2 = tmp2.getAbsolutePath
val arguments2: Array[String] = Array("-I", veppedPath, "-o", tmpPath2,
"--mustHaveGenotype", "Sample_101:HOM_VAR")
main(arguments2)
val size2 = new VCFFileReader(new File(tmp2_path), false).size
val size2 = new VCFFileReader(new File(tmpPath2), false).size
size2 shouldBe 0
}
......
......@@ -31,7 +31,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
var inputR1: File = _
@Input(doc = "R2 fastq file (gzipped allowed)", shortName = "R2", required = false)
var input_R2: Option[File] = None
var inputR2: Option[File] = None
/** Skip Trim fastq files */
var skipTrim: Boolean = config("skip_trim", default = false)
......@@ -48,13 +48,13 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
/** Returns files to store in summary */
def summaryFiles: Map[String, File] = {
Map("input_R1" -> inputR1, "output_R1" -> fastqR1Qc) ++
(if (paired) Map("input_R2" -> input_R2.get, "output_R2" -> fastqR2Qc.get) else Map())
(if (paired) Map("input_R2" -> inputR2.get, "output_R2" -> fastqR2Qc.get) else Map())
}
/** returns settings to store in summary */
def summarySettings = Map("skip_trim" -> skipTrim, "skip_clip" -> skipClip, "paired" -> paired)
var paired: Boolean = input_R2.isDefined
var paired: Boolean = inputR2.isDefined
var R1Name: String = _
var R2Name: String = _
......@@ -80,13 +80,13 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
require(sampleId != null, "Missing sample ID on flexiprep module")
require(libId != null, "Missing library ID on flexiprep module")
paired = input_R2.isDefined
paired = inputR2.isDefined
inputFiles :+= new InputFile(inputR1)
input_R2.foreach(inputFiles :+= new InputFile(_))
inputR2.foreach(inputFiles :+= new InputFile(_))
R1Name = getUncompressedFileName(inputR1)
input_R2.foreach { fileR2 =>
inputR2.foreach { fileR2 =>
paired = true
R2Name = getUncompressedFileName(fileR2)
}
......@@ -96,7 +96,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
def biopetScript() {
runInitialJobs()
if (paired) runTrimClip(inputR1, input_R2, outputDir)
if (paired) runTrimClip(inputR1, inputR2, outputDir)
else runTrimClip(inputR1, outputDir)
val R1Files = for ((k, v) <- outputFiles if k.endsWith("output_R1")) yield v
......@@ -107,7 +107,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
/** Add init non chunkable jobs */
def runInitialJobs() {
outputFiles += ("fastq_input_R1" -> inputR1)
if (paired) outputFiles += ("fastq_input_R2" -> input_R2.get)
if (paired) outputFiles += ("fastq_input_R2" -> inputR2.get)
fastqcR1 = Fastqc(this, inputR1, new File(outputDir, R1Name + ".fastqc/"))
add(fastqcR1)
......@@ -116,7 +116,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
val validateFastq = new ValidateFastq(this)
validateFastq.r1Fastq = inputR1
validateFastq.r2Fastq = input_R2
validateFastq.r2Fastq = inputR2
validateFastq.jobOutputFile = new File(outputDir, ".validate_fastq.log.out")
add(validateFastq)
......@@ -128,7 +128,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
}
if (paired) {
fastqcR2 = Fastqc(this, input_R2.get, new File(outputDir, R2Name + ".fastqc/"))
fastqcR2 = Fastqc(this, inputR2.get, new File(outputDir, R2Name + ".fastqc/"))
add(fastqcR2)
addSummarizable(fastqcR2, "fastqc_R2")
outputFiles += ("fastqc_R2" -> fastqcR2.output)
......@@ -140,7 +140,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
addSummarizable(seqstatR1, "seqstat_R1")
if (paired) {
val seqstatR2 = SeqStat(this, input_R2.get, outputDir)
val seqstatR2 = SeqStat(this, inputR2.get, outputDir)
seqstatR2.isIntermediate = true
add(seqstatR2)
addSummarizable(seqstatR2, "seqstat_R2")
......
......@@ -71,7 +71,7 @@ class FlexiprepTest extends TestNGSuite with Matchers {
val flexiprep: Flexiprep = initPipeline(map)
flexiprep.inputR1 = (if (zipped) FlexiprepTest.r1Zipped else FlexiprepTest.r1)
if (paired) flexiprep.input_R2 = Some((if (zipped) FlexiprepTest.r2Zipped else FlexiprepTest.r2))
if (paired) flexiprep.inputR2 = Some((if (zipped) FlexiprepTest.r2Zipped else FlexiprepTest.r2))
flexiprep.sampleId = Some("1")
flexiprep.libId = Some("1")
flexiprep.script()
......
......@@ -98,7 +98,7 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs
flexiprep.sampleId = Some(sampleId)
flexiprep.libId = Some(libId)
flexiprep.inputR1 = config("R1")
flexiprep.input_R2 = config("R2")
flexiprep.inputR2 = config("R2")
flexiprep.outputDir = new File(libDir, "flexiprep")
lazy val gs = new GearsSingle(qscript)
......@@ -109,7 +109,7 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs
/** Function that add library jobs */
protected def addJobs(): Unit = {
inputFiles :+= InputFile(flexiprep.inputR1, config("R1_md5"))
flexiprep.input_R2.foreach(inputFiles :+= InputFile(_, config("R2_md5")))
flexiprep.inputR2.foreach(inputFiles :+= InputFile(_, config("R2_md5")))
add(flexiprep)
gs.fastqR1 = Some(flexiprep.fastqR1Qc)
......
......@@ -80,7 +80,7 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
if (!skipFlexiprep) {
val flexiprep = new Flexiprep(this)
flexiprep.inputR1 = r1
flexiprep.input_R2 = r2
flexiprep.inputR2 = r2
flexiprep.outputDir = new File(outputDir, "flexiprep")
add(flexiprep)
(flexiprep.fastqR1Qc, flexiprep.fastqR2Qc)
......
......@@ -167,7 +167,7 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
if (!skipFlexiprep) {
flexiprep.outputDir = new File(outputDir, "flexiprep")
flexiprep.inputR1 = inputR1
flexiprep.input_R2 = inputR2
flexiprep.inputR2 = inputR2
flexiprep.sampleId = this.sampleId
flexiprep.libId = this.libId
flexiprep.init()
......@@ -184,7 +184,7 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
if (paired) Some(new File(chunkDir, inputR2.get.getName)) else None)
}).toMap
else if (skipFlexiprep) Map(outputDir -> (inputR1, if (paired) inputR2 else None))
else Map(outputDir -> (flexiprep.inputR1, flexiprep.input_R2))
else Map(outputDir -> (flexiprep.inputR1, flexiprep.inputR2))
}
if (chunking) {
......
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