use of htsjdk.samtools.filter.FilteringIterator in project ASCIIGenome by dariober.
the class SamLocusIterator method iterator.
public Iterator<LocusInfo> iterator() {
if (samIterator != null) {
throw new IllegalStateException("Cannot call iterator() more than once on SamLocusIterator");
}
CloseableIterator<SAMRecord> tempIterator;
if (intervals != null) {
tempIterator = new SamRecordIntervalIteratorFactory().makeSamRecordIntervalIterator(samReader, intervals, useIndex);
} else {
tempIterator = samReader.iterator();
}
if (samFilters != null) {
tempIterator = new FilteringIterator(tempIterator, new AggregateFilter(samFilters));
}
samIterator = new PeekableIterator<SAMRecord>(tempIterator);
return this;
}
Aggregations