Commit e86f6183 authored by bow's avatar bow
Browse files

Fix cryptic pipeline errors caused by using directory as output files

parent 9a5a8577
......@@ -30,17 +30,11 @@ class SamtoolsFlagstat(val root: Configurable) extends Samtools {
}
object SamtoolsFlagstat {
def apply(root: Configurable, input: File, output: File): SamtoolsFlagstat = {
def apply(root: Configurable, input: File, outputDir: File): SamtoolsFlagstat = {
val flagstat = new SamtoolsFlagstat(root)
flagstat.input = input
flagstat.output = output
return flagstat
}
def apply(root: Configurable, input: File, outputDir: String): SamtoolsFlagstat = {
val dir = if (outputDir.endsWith("/")) outputDir else outputDir + "/"
val outputFile = new File(dir + swapExtension(input.getName))
return apply(root, input, outputFile)
flagstat.output = new File(outputDir + swapExtension(input.getName))
flagstat
}
def apply(root: Configurable, input: File): SamtoolsFlagstat = {
......
......@@ -40,17 +40,11 @@ class BiopetFlagstat(val root: Configurable) extends BiopetJavaCommandLineFuncti
}
object BiopetFlagstat extends ToolCommand {
def apply(root: Configurable, input: File, output: File): BiopetFlagstat = {
val flagstat = new BiopetFlagstat(root)
flagstat.input = input
flagstat.output = output
return flagstat
}
def apply(root: Configurable, input: File, outputDir: String): BiopetFlagstat = {
def apply(root: Configurable, input: File, outputDir: File): BiopetFlagstat = {
val flagstat = new BiopetFlagstat(root)
flagstat.input = input
flagstat.output = new File(outputDir, input.getName.stripSuffix(".bam") + ".biopetflagstat")
return flagstat
flagstat
}
case class Args(inputFile: File = null, region: Option[String] = None) extends AbstractArgs
......
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