Search in sources :

Example 1 with FilteringIterator

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;
}
Also used : AggregateFilter(htsjdk.samtools.filter.AggregateFilter) SAMRecord(htsjdk.samtools.SAMRecord) FilteringIterator(htsjdk.samtools.filter.FilteringIterator) SamRecordIntervalIteratorFactory(htsjdk.samtools.util.SamRecordIntervalIteratorFactory)

Aggregations

SAMRecord (htsjdk.samtools.SAMRecord)1 AggregateFilter (htsjdk.samtools.filter.AggregateFilter)1 FilteringIterator (htsjdk.samtools.filter.FilteringIterator)1 SamRecordIntervalIteratorFactory (htsjdk.samtools.util.SamRecordIntervalIteratorFactory)1