Commit a0cfa199 authored by Peter van 't Hof's avatar Peter van 't Hof

Switch to GatherBamFiles

parent 3e834749
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.extensions.gatk.gather.{CatVariantsGatherer, MergeSamFiles}
import nl.lumc.sasc.biopet.extensions.gatk.gather.{GatherVcfs, GatherBamFiles}
import nl.lumc.sasc.biopet.extensions.gatk.scatter.{GATKScatterFunction, LocusScatterFunction}
import nl.lumc.sasc.biopet.utils.VcfUtils
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -31,7 +31,7 @@ class HaplotypeCaller(val parent: Configurable) extends CommandLineGATK with Sca
/** File to which variants should be written */
@Output(fullName = "out", shortName = "o", doc = "File to which variants should be written", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[CatVariantsGatherer])
@Gather(classOf[GatherVcfs])
var out: File = _
/** What likelihood calculation engine to use to calculate the relative likelihood of reads vs haplotypes */
......@@ -98,7 +98,7 @@ class HaplotypeCaller(val parent: Configurable) extends CommandLineGATK with Sca
/** File to which assembled haplotypes should be written */
@Output(fullName = "bamOutput", shortName = "bamout", doc = "File to which assembled haplotypes should be written", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[MergeSamFiles])
@Gather(classOf[GatherBamFiles])
var bamOutput: File = _
/** Automatically generated md5 for bamOutput */
......
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.extensions.gatk.gather.MergeSamFiles
import nl.lumc.sasc.biopet.extensions.gatk.gather.GatherBamFiles
import nl.lumc.sasc.biopet.extensions.gatk.scatter.{ContigScatterFunction, GATKScatterFunction}
import nl.lumc.sasc.biopet.utils.VcfUtils
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -47,7 +47,7 @@ class IndelRealigner(val parent: Configurable) extends CommandLineGATK with Scat
/** Output bam */
@Output(fullName = "out", shortName = "o", doc = "Output bam", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[MergeSamFiles])
@Gather(classOf[GatherBamFiles])
var out: File = _
/** Automatically generated md5 for out */
......
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.extensions.gatk.gather.MergeSamFiles
import nl.lumc.sasc.biopet.extensions.gatk.gather.GatherBamFiles
import nl.lumc.sasc.biopet.extensions.gatk.scatter.{ContigScatterFunction, GATKScatterFunction}
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline._
......@@ -29,7 +29,7 @@ class PrintReads(val parent: Configurable) extends CommandLineGATK with ScatterG
/** Write output to this BAM filename instead of STDOUT */
@Output(fullName = "out", shortName = "o", doc = "Write output to this BAM filename instead of STDOUT", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[MergeSamFiles])
@Gather(classOf[GatherBamFiles])
var out: File = _
/** Exclude all reads with this read group from the output */
......
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.extensions.gatk
import java.io.File
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.extensions.gatk.gather.CatVariantsGatherer
import nl.lumc.sasc.biopet.extensions.gatk.gather.GatherVcfs
import nl.lumc.sasc.biopet.extensions.gatk.scatter.{GATKScatterFunction, LocusScatterFunction}
import nl.lumc.sasc.biopet.utils.VcfUtils
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -51,7 +51,7 @@ class VariantAnnotator(val parent: Configurable) extends CommandLineGATK with Sc
/** File to which variants should be written */
@Output(fullName = "out", shortName = "o", doc = "File to which variants should be written", required = false, exclusiveOf = "", validation = "")
@Gather(classOf[CatVariantsGatherer])
@Gather(classOf[GatherVcfs])
var out: File = _
/** One or more specific annotations to apply to variant calls */
......
......@@ -27,6 +27,8 @@ import org.broadinstitute.gatk.queue.function.scattergather.GatherFunction
* \@Gather(className = "org.broadinstitute.gatk.queue.extensions.gatk.CatVariantsGatherer")
* \@Output(doc="File to which variants should be written",required=true)
* protected VariantContextWriter writer = null;
*
* @deprecated
*/
class CatVariantsGatherer extends CatVariants(null) with GatherFunction {
this.assumeSorted = true
......
package nl.lumc.sasc.biopet.extensions.gatk.gather
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.extensions.gatk.CommandLineGATK
import nl.lumc.sasc.biopet.extensions.picard
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
import org.broadinstitute.gatk.queue.function.scattergather.GatherFunction
/**
* Created by pjvan_thof on 13-7-17.
*/
class GatherBamFiles extends picard.GatherBamFiles(null) with GatherFunction {
analysisName = "Gather_Bam_Files"
override val parent = originalFunction match {
case b: BiopetCommandLineFunction => b
case _ => null
}
override def freezeFieldValues() {
val originalGATK = this.originalFunction.asInstanceOf[CommandLineGATK]
this.input = this.gatherParts.zipWithIndex map { case (input, index) => new TaggedFile(input, "input" + index) }
this.output = this.originalOutput
super.freezeFieldValues()
}
}
......@@ -10,7 +10,7 @@ import org.broadinstitute.gatk.queue.function.scattergather.GatherFunction
* Created by pjvan_thof on 12-7-17.
*/
class GatherVcfs extends picard.GatherVcfs(null) with GatherFunction {
analysisName = "Gather_CatVariants"
analysisName = "Gather_Vcfs"
override val parent = originalFunction match {
case b: BiopetCommandLineFunction => b
......
......@@ -21,6 +21,8 @@ import org.broadinstitute.gatk.queue.function.scattergather.GatherFunction
/**
* Merges BAM files using htsjdk.samtools.MergeSamFiles.
*
* @deprecated
*/
class MergeSamFiles extends picard.MergeSamFiles(null) with GatherFunction {
......
......@@ -22,7 +22,7 @@ import org.broadinstitute.gatk.utils.commandline.{Input, Output}
class GatherBamFiles(val parent: Configurable) extends Picard {
@Input(doc = "The input SAM or BAM files to analyze.", required = true)
var input: List[File] = Nil
var input: Seq[File] = Nil
@Output(doc = "The output file to bam file to", required = true)
var output: File = _
......
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