Inherit BamGatherFunction from MergeSamFiles rather than PicardBamFunction
- This change means that BamGatherFunction will now have an @Output field for the BAM index, which will allow the bai to be deleted for intermediate functions Signed-off-by: Khalid Shakir <kshakir@broadinstitute.org>
This commit is contained in:
parent
504c125c26
commit
0405afeab2
|
|
@ -26,7 +26,7 @@
|
||||||
package org.broadinstitute.sting.queue.extensions.gatk
|
package org.broadinstitute.sting.queue.extensions.gatk
|
||||||
|
|
||||||
import org.broadinstitute.sting.queue.function.scattergather.GatherFunction
|
import org.broadinstitute.sting.queue.function.scattergather.GatherFunction
|
||||||
import org.broadinstitute.sting.queue.extensions.picard.PicardBamFunction
|
import org.broadinstitute.sting.queue.extensions.picard.MergeSamFiles
|
||||||
import org.broadinstitute.sting.queue.function.{RetryMemoryLimit, QFunction}
|
import org.broadinstitute.sting.queue.function.{RetryMemoryLimit, QFunction}
|
||||||
import org.broadinstitute.sting.gatk.io.stubs.SAMFileWriterArgumentTypeDescriptor
|
import org.broadinstitute.sting.gatk.io.stubs.SAMFileWriterArgumentTypeDescriptor
|
||||||
import org.broadinstitute.sting.queue.util.ClassFieldCache
|
import org.broadinstitute.sting.queue.util.ClassFieldCache
|
||||||
|
|
@ -34,13 +34,17 @@ import org.broadinstitute.sting.queue.util.ClassFieldCache
|
||||||
/**
|
/**
|
||||||
* Merges BAM files using net.sf.picard.sam.MergeSamFiles.
|
* Merges BAM files using net.sf.picard.sam.MergeSamFiles.
|
||||||
*/
|
*/
|
||||||
class BamGatherFunction extends GatherFunction with PicardBamFunction with RetryMemoryLimit {
|
class BamGatherFunction extends MergeSamFiles with GatherFunction with RetryMemoryLimit {
|
||||||
this.javaMainClass = "net.sf.picard.sam.MergeSamFiles"
|
|
||||||
this.assumeSorted = Some(true)
|
this.assumeSorted = Some(true)
|
||||||
protected def inputBams = gatherParts
|
|
||||||
protected def outputBam = originalOutput
|
|
||||||
|
|
||||||
override def freezeFieldValues() {
|
override def freezeFieldValues() {
|
||||||
|
this.input = this.gatherParts
|
||||||
|
this.output = this.originalOutput
|
||||||
|
//Left to its own devices (ie, MergeSamFiles.freezeFieldValues), outputIndex
|
||||||
|
//will be in the gather directory. Ensure that it actually matches this.output
|
||||||
|
if (output != null)
|
||||||
|
outputIndex = new File(output.getParentFile(), output.getName.stripSuffix(".bam") + ".bai")
|
||||||
|
|
||||||
val originalGATK = originalFunction.asInstanceOf[CommandLineGATK]
|
val originalGATK = originalFunction.asInstanceOf[CommandLineGATK]
|
||||||
|
|
||||||
// Whatever the original function can handle, merging *should* do less.
|
// Whatever the original function can handle, merging *should* do less.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue