Final version of bp-resolved locus scatter/gather

-- Minor refactoring to allow LocusScatterFunction to have maxIntervals be the original scatter count, rather than capping this by the interval count as Contig and Interval do
This commit is contained in:
Mark DePristo 2011-11-02 11:26:34 -04:00
parent 392e0aeace
commit c1da8cd5e7
3 changed files with 16 additions and 11 deletions

View File

@ -35,6 +35,8 @@ class ContigScatterFunction extends GATKScatterFunction with InProcessFunction {
// Include unmapped reads by default. // Include unmapped reads by default.
this.includeUnmapped = true this.includeUnmapped = true
override def scatterCount = if (intervalFilesExist) super.scatterCount min this.maxIntervals else super.scatterCount
protected override def maxIntervals = { protected override def maxIntervals = {
GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals).contigs.size GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals).contigs.size
} }

View File

@ -35,6 +35,8 @@ class IntervalScatterFunction extends GATKScatterFunction with InProcessFunction
protected override def maxIntervals = protected override def maxIntervals =
GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals).locs.size GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals).locs.size
override def scatterCount = if (intervalFilesExist) super.scatterCount min this.maxIntervals else super.scatterCount
def run() { def run() {
val gi = GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals) val gi = GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals)
val splits = IntervalUtils.splitFixedIntervals(gi.locs, this.scatterOutputFiles.size) val splits = IntervalUtils.splitFixedIntervals(gi.locs, this.scatterOutputFiles.size)

View File

@ -24,20 +24,21 @@
package org.broadinstitute.sting.queue.extensions.gatk package org.broadinstitute.sting.queue.extensions.gatk
import collection.JavaConversions._
import org.broadinstitute.sting.utils.interval.IntervalUtils import org.broadinstitute.sting.utils.interval.IntervalUtils
import org.broadinstitute.sting.queue.function.InProcessFunction import org.broadinstitute.sting.queue.function.InProcessFunction
/** /**
* A scatter function that divides down to the locus level. * A scatter function that divides down to the locus level.
*/ */
class LocusScatterFunction extends IntervalScatterFunction { //class LocusScatterFunction extends IntervalScatterFunction { }
class LocusScatterFunction extends GATKScatterFunction with InProcessFunction {
protected override def maxIntervals = scatterCount
def run() {
val gi = GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals)
val splits = IntervalUtils.splitLocusIntervals(gi.locs, this.scatterOutputFiles.size)
IntervalUtils.scatterFixedIntervals(gi.samFileHeader, splits, this.scatterOutputFiles)
}
} }
//
//class LocusScatterFunction extends GATKScatterFunction with InProcessFunction {
// // todo -- max intervals is actually the original scatter count, not capped by interval size
// def run() {
// val gi = GATKScatterFunction.getGATKIntervals(this.referenceSequence, this.intervals)
// val splits = IntervalUtils.splitLocusIntervals(gi.locs, this.scatterOutputFiles.size)
// IntervalUtils.scatterFixedIntervals(gi.samFileHeader, splits, this.scatterOutputFiles)
// }
//}