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

Move scatter functions to biopet extensions

parent 5370d60d
......@@ -35,10 +35,6 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
@Input(doc = "deps", required = false)
var deps: List[File] = Nil
@Output
@Gather(enabled = false)
var outputFiles: List[File] = Nil
var executable: String = _
/** This is the default shell for drmaa jobs */
......
......@@ -61,9 +61,6 @@ class BiopetFifoPipe(val root: Configurable,
val fifoFiles = fifos
outputFiles :::= outputs.values.toList.flatten.filter(!fifoFiles.contains(_))
outputFiles = outputFiles.distinct
deps :::= inputs.values.toList.flatten.filter(!fifoFiles.contains(_))
deps = deps.distinct
......
......@@ -17,9 +17,9 @@ package nl.lumc.sasc.biopet.extensions
import java.io.File
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.Input
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import scala.util.matching.Regex
......@@ -64,16 +64,33 @@ class Flash(val root: Configurable) extends BiopetCommandLineFunction with Versi
private def suffix = outputSuffix.getOrElse("fastq") + (if (compress) ".gz" else "")
def combinedFastq = new File(outputDirectory, s"$outputPrefix.extendedFrags.$suffix")
def notCombinedR1 = new File(outputDirectory, s"$outputPrefix.notCombined_1.$suffix")
def notCombinedR2 = new File(outputDirectory, s"$outputPrefix.notCombined_2.$suffix")
def outputHistogramTable = new File(outputDirectory, s"$outputPrefix.hist")
def outputHistogram = new File(outputDirectory, s"$outputPrefix.histogram")
@Output
private var _combinedFastq: File = _
def combinedFastq = _combinedFastq
@Output
private var _notCombinedR1: File = _
def notCombinedR1 = _notCombinedR1
@Output
private var _notCombinedR2: File = _
def notCombinedR2 = _notCombinedR2
@Output
private var _outputHistogramTable: File = _
def outputHistogramTable = _outputHistogramTable
@Output
private var _outputHistogram: File = _
def outputHistogram = _outputHistogram
override def beforeGraph(): Unit = {
super.beforeGraph()
outputFiles :::= combinedFastq :: notCombinedR1 ::
notCombinedR2 :: outputHistogramTable :: outputHistogram :: Nil
_combinedFastq = new File(outputDirectory, s"$outputPrefix.extendedFrags.$suffix")
_notCombinedR1 = new File(outputDirectory, s"$outputPrefix.notCombined_1.$suffix")
_notCombinedR2 = new File(outputDirectory, s"$outputPrefix.notCombined_2.$suffix")
_outputHistogramTable = new File(outputDirectory, s"$outputPrefix.hist")
_outputHistogram = new File(outputDirectory, s"$outputPrefix.histogram")
}
def cmdLine = executable +
......
......@@ -49,6 +49,9 @@ class RunGubbins(val root: Configurable) extends BiopetCommandLineFunction {
var verbose: Boolean = config("verbose", default = false)
var noCleanup: Boolean = config("no_cleanup", default = false)
@Output
var outputFiles: List[File] = Nil
/** Set correct output files */
override def beforeGraph(): Unit = {
super.beforeGraph()
......
......@@ -65,6 +65,9 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction with Versi
/** Formats that tabix can handle */
private val validFormats: Set[String] = Set("gff", "bed", "sam", "vcf", "psltbl")
@Output
var outputFiles: List[File] = Nil
override def beforeGraph(): Unit = {
super.beforeGraph()
p match {
......
......@@ -150,6 +150,9 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
override def defaultCoreMemory = 4.0
@Output
private var _summary: File = null
override def beforeGraph(): Unit = {
super.beforeGraph()
if (!cache && !database) {
......@@ -157,7 +160,7 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
} else if (cache && dir.isEmpty) {
Logging.addError("Must supply dir to cache for VariantEffectPredictor")
}
if (statsText) outputFiles :+= new File(output.getAbsolutePath + "_summary.txt")
if (statsText) _summary = new File(output.getAbsolutePath + "_summary.txt")
}
/** Returns command to execute */
......
......@@ -17,9 +17,9 @@ package nl.lumc.sasc.biopet.extensions.bowtie
import java.io.File
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input }
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
/**
* Created by pjvan_thof on 8/15/15.
......@@ -37,6 +37,9 @@ class Bowtie2Build(val root: Configurable) extends BiopetCommandLineFunction wit
override def defaultCoreMemory = 15.0
@Output
private var outputFiles: List[File] = Nil
override def beforeGraph: Unit = {
outputFiles ::= new File(reference.getParentFile, baseName + ".1.bt2")
outputFiles ::= new File(reference.getParentFile, baseName + ".2.bt2")
......
......@@ -17,9 +17,9 @@ package nl.lumc.sasc.biopet.extensions.bowtie
import java.io.File
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input }
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
/**
* Created by pjvan_thof on 8/15/15.
......@@ -37,6 +37,9 @@ class BowtieBuild(val root: Configurable) extends BiopetCommandLineFunction with
override def defaultCoreMemory = 15.0
@Output
private var outputFiles: List[File] = Nil
override def beforeGraph: Unit = {
outputFiles ::= new File(reference.getParentFile, baseName + ".1.ebwt")
outputFiles ::= new File(reference.getParentFile, baseName + ".2.ebwt")
......
......@@ -17,8 +17,9 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.utils.VcfUtils
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import org.broadinstitute.gatk.utils.commandline.{ Gather, Input, Output }
/**
* Extension for CombineVariants from GATK
......@@ -47,9 +48,13 @@ class CombineVariants(val root: Configurable) extends Gatk {
inputMap += file -> name
}
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def beforeGraph(): Unit = {
super.beforeGraph()
if (outputFile.getName.endsWith(".vcf.gz")) outputFiles :+= new File(outputFile.getAbsolutePath + ".tbi")
outputIndex = VcfUtils.getVcfIndexFile(outputFile)
genotypeMergeOptions match {
case Some("UNIQUIFY") | Some("PRIORITIZE") | Some("UNSORTED") | Some("REQUIRE_UNIQUE") | None =>
case _ => throw new IllegalArgumentException("Wrong option for genotypeMergeOptions")
......
......@@ -17,8 +17,9 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.utils.VcfUtils
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import org.broadinstitute.gatk.utils.commandline.{ Gather, Input, Output }
/**
* Extension for CombineVariants from GATK
......@@ -43,9 +44,13 @@ class SelectVariants(val root: Configurable) extends Gatk {
inputMap += file -> name
}
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def beforeGraph(): Unit = {
super.beforeGraph()
if (outputFile.getName.endsWith(".vcf.gz")) outputFiles :+= new File(outputFile.getAbsolutePath + ".tbi")
outputIndex = VcfUtils.getVcfIndexFile(outputFile)
deps :::= inputFiles.filter(_.getName.endsWith("vcf.gz")).map(x => new File(x.getAbsolutePath + ".tbi"))
deps = deps.distinct
}
......
......@@ -82,14 +82,17 @@ class ApplyRecalibration(val root: Configurable) extends CommandLineGATK with Sc
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def beforeGraph() {
super.beforeGraph()
deps ++= input.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (recal_file != null)
deps :+= VcfUtils.getVcfIndexFile(recal_file)
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outputFiles :+= VcfUtils.getVcfIndexFile(out)
outputIndex = VcfUtils.getVcfIndexFile(out)
num_threads = Option(getThreads)
}
......
package nl.lumc.sasc.biopet.extensions.gatk.broad
import org.broadinstitute.gatk.queue.function.scattergather.GatherFunction
import org.broadinstitute.gatk.queue.function.RetryMemoryLimit
import java.io.File
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.extensions.picard.MergeSamFiles
/**
* Merges BAM files using htsjdk.samtools.MergeSamFiles.
*/
class BamGatherFunction extends MergeSamFiles(null) with GatherFunction {
override val root = originalFunction match {
case b: BiopetCommandLineFunction => b
case _ => null
}
this.assumeSorted = true
override def freezeFieldValues() {
this.input = this.gatherParts.toList
this.output = this.originalOutput
this.sortOrder = "coordinate"
//Left to its own devices (ie, MergeSamFiles.freezeFieldValues), outputIndex
//will be in the gather directory. Ensure that it actually matches this.output
val originalGATK = originalFunction.asInstanceOf[CommandLineGATK]
// Whatever the original function can handle, merging *should* do less.
this.createIndex = !originalGATK.disable_bam_indexing
super.freezeFieldValues()
}
}
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.Argument
import org.broadinstitute.gatk.utils.commandline.Gather
import org.broadinstitute.gatk.utils.commandline.Input
import org.broadinstitute.gatk.utils.commandline.Output
class CatVariants(val root: Configurable) extends BiopetJavaCommandLineFunction {
analysisName = "CatVariants"
javaMainClass = "org.broadinstitute.gatk.tools.CatVariants"
/** genome reference file <name>.fasta */
@Input(fullName = "reference", shortName = "R", doc = "genome reference file <name>.fasta", required = true, exclusiveOf = "", validation = "")
var reference: File = _
/** Input VCF file/s */
@Input(fullName = "variant", shortName = "V", doc = "Input VCF file/s", required = true, exclusiveOf = "", validation = "")
var variant: Seq[File] = Nil
/** output file */
@Output(fullName = "outputFile", shortName = "out", doc = "output file", required = true, exclusiveOf = "", validation = "")
@Gather(classOf[org.broadinstitute.gatk.queue.function.scattergather.SimpleTextGatherFunction])
var outputFile: File = _
/** assumeSorted should be true if the input files are already sorted (based on the position of the variants) */
@Argument(fullName = "assumeSorted", shortName = "assumeSorted", doc = "assumeSorted should be true if the input files are already sorted (based on the position of the variants)", required = false, exclusiveOf = "", validation = "")
var assumeSorted: Boolean = _
/** which type of IndexCreator to use for VCF/BCF indices */
@Argument(fullName = "variant_index_type", shortName = "", doc = "which type of IndexCreator to use for VCF/BCF indices", required = false, exclusiveOf = "", validation = "")
var variant_index_type: Option[String] = None
/** the parameter (bin width or features per bin) to pass to the VCF/BCF IndexCreator */
@Argument(fullName = "variant_index_parameter", shortName = "", doc = "the parameter (bin width or features per bin) to pass to the VCF/BCF IndexCreator", required = false, exclusiveOf = "", validation = "")
var variant_index_parameter: Option[Int] = None
/** Set the minimum level of logging */
@Argument(fullName = "logging_level", shortName = "l", doc = "Set the minimum level of logging", required = false, exclusiveOf = "", validation = "")
var logging_level: String = _
/** Set the logging location */
@Output(fullName = "log_to_file", shortName = "log", doc = "Set the logging location", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[org.broadinstitute.gatk.queue.function.scattergather.SimpleTextGatherFunction])
var log_to_file: File = _
override def cmdLine = super.cmdLine +
required("-R", reference, spaceSeparated = true, escape = true, format = "%s") +
repeat("-V", variant, spaceSeparated = true, escape = true, format = "%s") +
required("-out", outputFile, spaceSeparated = true, escape = true, format = "%s") +
conditional(assumeSorted, "-assumeSorted", escape = true, format = "%s") +
optional("--variant_index_type", variant_index_type, spaceSeparated = true, escape = true, format = "%s") +
optional("--variant_index_parameter", variant_index_parameter, spaceSeparated = true, escape = true, format = "%s") +
optional("-l", logging_level, spaceSeparated = true, escape = true, format = "%s") +
optional("-log", log_to_file, spaceSeparated = true, escape = true, format = "%s")
}
package nl.lumc.sasc.biopet.extensions.gatk.broad
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import org.broadinstitute.gatk.queue.function.RetryMemoryLimit
import org.broadinstitute.gatk.queue.function.scattergather.GatherFunction
/**
*
* Currently this is the default gather for VCFs.
* One can set a specific gatherer to use by adding @Gather before any output argument.
* For example (used to be part of UG):
* \@Gather(className = "org.broadinstitute.gatk.queue.extensions.gatk.CatVariantsGatherer")
* \@Output(doc="File to which variants should be written",required=true)
* protected VariantContextWriter writer = null;
*/
class CatVariantsGatherer extends CatVariants(null) with GatherFunction {
this.assumeSorted = true
analysisName = "Gather_CatVariants"
override val root = originalFunction match {
case b: BiopetCommandLineFunction => b
case _ => null
}
override def freezeFieldValues() {
val originalGATK = this.originalFunction.asInstanceOf[CommandLineGATK]
this.reference = originalGATK.reference_sequence
this.variant = this.gatherParts.zipWithIndex map { case (input, index) => new TaggedFile(input, "input" + index) }
this.outputFile = this.originalOutput
this.assumeSorted = true
this.variant_index_type = originalGATK.variant_index_type
this.variant_index_parameter = originalGATK.variant_index_parameter
super.freezeFieldValues()
}
}
......@@ -8,7 +8,7 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{ Gather, Input, Output, _ }
......@@ -59,13 +59,16 @@ class CombineGVCFs(val root: Configurable) extends CommandLineGATK with ScatterG
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def beforeGraph() {
super.beforeGraph()
dbsnp.foreach(deps :+= VcfUtils.getVcfIndexFile(_))
deps ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outputFiles :+= VcfUtils.getVcfIndexFile(out)
outputIndex = VcfUtils.getVcfIndexFile(out)
}
override def cmdLine = super.cmdLine +
......
......@@ -8,7 +8,7 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Output, _ }
......@@ -91,12 +91,15 @@ class CombineVariants(val root: Configurable) extends CommandLineGATK with Scatt
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def beforeGraph() {
super.beforeGraph()
deps ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!org.broadinstitute.gatk.utils.commandline.ArgumentTypeDescriptor.isCompressed(out.getPath))
outputFiles :+= VcfUtils.getVcfIndexFile(out)
outputIndex = VcfUtils.getVcfIndexFile(out)
}
override def cmdLine = super.cmdLine +
......
......@@ -5,8 +5,8 @@ import org.broadinstitute.gatk.utils.interval.IntervalUtils
import org.broadinstitute.gatk.queue.function.InProcessFunction
/**
* Splits intervals by contig instead of evenly.
*/
* Splits intervals by contig instead of evenly.
*/
class ContigScatterFunction extends GATKScatterFunction with InProcessFunction {
override def scatterCount = if (intervalFilesExist) super.scatterCount min this.maxIntervals else super.scatterCount
......
......@@ -8,7 +8,7 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Output, _ }
......@@ -107,11 +107,15 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def freezeFieldValues() {
super.freezeFieldValues()
deps ++= variant.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
outputFiles :+= VcfUtils.getVcfIndexFile(out)
outputIndex = VcfUtils.getVcfIndexFile(out)
dbsnp.foreach(VcfUtils.getVcfIndexFile(_))
}
......
......@@ -8,10 +8,10 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk._
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Input, _ }
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Input, Output }
class HaplotypeCaller(val root: Configurable) extends CommandLineGATK with ScatterGatherableFunction {
def analysis_type = "HaplotypeCaller"
......@@ -396,15 +396,23 @@ class HaplotypeCaller(val root: Configurable) extends CommandLineGATK with Scatt
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
@Output
@Gather(enabled = false)
private var outputIndex: File = _
@Output
@Gather(enabled = false)
private var outputBamIndex: File = _
override def beforeGraph() {
super.beforeGraph()
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
outputFiles :+= VcfUtils.getVcfIndexFile(out)
outputIndex = VcfUtils.getVcfIndexFile(out)
dbsnp.foreach(deps :+= VcfUtils.getVcfIndexFile(_))
deps ++= comp.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => new File(orig + ".idx"))
if (bamOutput != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(bamOutput))
if (!disable_bam_indexing)
outputFiles :+= new File(bamOutput.getPath.stripSuffix(".bam") + ".bai")
outputBamIndex = new File(bamOutput.getPath.stripSuffix(".bam") + ".bai")
if (bamOutput != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(bamOutput))
if (generate_md5)
bamOutputMD5 = new File(bamOutput.getPath + ".md5")
......
......@@ -8,7 +8,7 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{ BamGatherFunction, TaggedFile }
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.utils.VcfUtils
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Output, _ }
......@@ -131,12 +131,16 @@ class IndelRealigner(val root: Configurable) extends CommandLineGATK with Scatte
@Argument(fullName = "filter_bases_not_stored", shortName = "filterNoBases", doc = "Filter out reads with no stored bases (i.e. '*' where the sequence should be), instead of failing with an error", required = false, exclusiveOf = "", validation = "")
var filter_bases_not_stored: Boolean = config("filter_bases_not_stored", default = false)
@Output
@Gather(enabled = false)
private var outputIndex: File = _
override def beforeGraph() {
super.beforeGraph()
deps ++= knownAlleles.filter(orig => orig != null && (!orig.getName.endsWith(".list"))).map(orig => VcfUtils.getVcfIndexFile(orig))
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (!disable_bam_indexing)
outputFiles :+= new File(out.getPath.stripSuffix(".bam") + ".bai")
outputIndex = new File(out.getPath.stripSuffix(".bam") + ".bai")
if (out != null && !org.broadinstitute.gatk.utils.io.IOUtils.isSpecialFile(out))
if (generate_md5)
outMD5 = new File(out.getPath + ".md5")
......
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