Search in sources :

Example 1 with IntervalLocusIterator

use of org.broadinstitute.hellbender.utils.iterators.IntervalLocusIterator in project gatk by broadinstitute.

the class LocusWalker method createAlignmentContextIterator.

private Iterator<AlignmentContext> createAlignmentContextIterator(SAMFileHeader header, LocusIteratorByState libs) {
    Iterator<AlignmentContext> iterator;
    validateEmitEmptyLociParameters();
    if (emitEmptyLoci()) {
        // If no intervals were specified, then use the entire reference (or best available sequence dictionary).
        if (intervalsForTraversal == null) {
            intervalsForTraversal = IntervalUtils.getAllIntervalsForReference(getBestAvailableSequenceDictionary());
        }
        final IntervalLocusIterator intervalLocusIterator = new IntervalLocusIterator(intervalsForTraversal.iterator());
        iterator = new IntervalAlignmentContextIterator(libs, intervalLocusIterator, header.getSequenceDictionary());
    } else {
        // prepare the iterator
        iterator = (hasIntervals()) ? new IntervalOverlappingIterator<>(libs, intervalsForTraversal, header.getSequenceDictionary()) : libs;
    }
    return iterator;
}
Also used : IntervalOverlappingIterator(org.broadinstitute.hellbender.utils.iterators.IntervalOverlappingIterator) IntervalLocusIterator(org.broadinstitute.hellbender.utils.iterators.IntervalLocusIterator) IntervalAlignmentContextIterator(org.broadinstitute.hellbender.utils.iterators.IntervalAlignmentContextIterator)

Aggregations

IntervalAlignmentContextIterator (org.broadinstitute.hellbender.utils.iterators.IntervalAlignmentContextIterator)1 IntervalLocusIterator (org.broadinstitute.hellbender.utils.iterators.IntervalLocusIterator)1 IntervalOverlappingIterator (org.broadinstitute.hellbender.utils.iterators.IntervalOverlappingIterator)1