use of org.broadinstitute.hellbender.utils.iterators.IntervalAlignmentContextIterator 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;
}
Aggregations