Commit 192a590f authored by Sander Bollen's avatar Sander Bollen
Browse files

Merge branch 'develop' into feature-toucan

parents a5b9de0f 1047c24a
......@@ -31,10 +31,10 @@ class Fastqc(val root: Configurable) extends BiopetCommandLineFunction {
var adapters: Option[File] = None
@Input(doc = "Fastq file", shortName = "FQ")
var fastqfile: File = _
var fastqfile: File = null
@Output(doc = "Output", shortName = "out")
var output: File = _
var output: File = null
executable = config("exe", default = "fastqc")
var java_exe: String = config("exe", default = "java", submodule = "java", freeVar = false)
......@@ -50,19 +50,31 @@ class Fastqc(val root: Configurable) extends BiopetCommandLineFunction {
override def afterGraph {
this.checkExecutable
val fastqcDir = executable.substring(0, executable.lastIndexOf("/"))
contaminants = contaminants match {
// user-defined contaminants file take precedence
case userDefinedValue @ Some(_) => userDefinedValue
// otherwise, use default contaminants file (depending on FastQC version)
case None =>
val fastqcDir = executable.substring(0, executable.lastIndexOf("/"))
val defaultContams = getVersion match {
case "v0.11.2" => Option(new File(fastqcDir + "/Configuration/contaminant_list.txt"))
case _ => Option(new File(fastqcDir + "/Contaminants/contaminant_list.txt"))
case "v0.11.2" => new File(fastqcDir + "/Configuration/contaminant_list.txt")
case _ => new File(fastqcDir + "/Contaminants/contaminant_list.txt")
}
config("contaminants", default = defaultContams)
}
adapters = adapters match {
// user-defined contaminants file take precedence
case userDefinedValue @ Some(_) => userDefinedValue
// otherwise, check if adapters are already present (depending on FastQC version)
case None =>
val defaultAdapters = getVersion match {
case "v0.11.2" => Option(new File(fastqcDir + "/Configuration/adapter_list.txt"))
case _ => None
}
config("contaminants", default = defaultContams)
case wrapped @ Some(_) => wrapped
defaultAdapters.collect { case adp => config("adapters", default = adp) }
}
}
......
......@@ -155,7 +155,7 @@ class Fastqc(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Fastqc(r
"fastqc_data" -> "fastqc_data.txt")
.map {
case (name, relPath) =>
name -> Map("path" -> (outputDir + relPath))
name -> Map("path" -> (outputDir + File.separator + relPath))
}
ConfigUtils.mapToJson(outputMap)
......
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