/** * Prepare to iterate through SAMRecords that match the given intervals. * @param intervals the intervals to restrict reads to * @param contained if <code>true</code>, return records that are strictly * contained in the intervals, otherwise return records that overlap * @param filePointers file pointer pairs corresponding to chunk boundaries for the * intervals */ public CloseableIterator<SAMRecord> createIndexIterator(final QueryInterval[] intervals, final boolean contained, final long[] filePointers) { assertIntervalsOptimized(intervals); // Create an iterator over the above chunk boundaries. final BAMFileIndexIterator iterator = new BAMFileIndexIterator(filePointers); // Add some preprocessing filters for edge-case reads that don't fit into this // query type. return new BAMQueryFilteringIterator(iterator, new BAMQueryMultipleIntervalsIteratorFilter(intervals, contained)); }
/** * Prepare to iterate through SAMRecords that match the given intervals. * @param intervals the intervals to restrict reads to * @param contained if <code>true</code>, return records that are strictly * contained in the intervals, otherwise return records that overlap * @param filePointers file pointer pairs corresponding to chunk boundaries for the * intervals */ public CloseableIterator<SAMRecord> createIndexIterator(final QueryInterval[] intervals, final boolean contained, final long[] filePointers) { assertIntervalsOptimized(intervals); // Create an iterator over the above chunk boundaries. final BAMFileIndexIterator iterator = new BAMFileIndexIterator(filePointers); // Add some preprocessing filters for edge-case reads that don't fit into this // query type. return new BAMQueryFilteringIterator(iterator, new BAMQueryMultipleIntervalsIteratorFilter(intervals, contained)); }
/** * Prepare to iterate through SAMRecords that match the given intervals. * @param intervals the intervals to restrict reads to * @param contained if <code>true</code>, return records that are strictly * contained in the intervals, otherwise return records that overlap * @param filePointers file pointer pairs corresponding to chunk boundaries for the * intervals */ public CloseableIterator<SAMRecord> createIndexIterator(final QueryInterval[] intervals, final boolean contained, final long[] filePointers) { assertIntervalsOptimized(intervals); // Create an iterator over the above chunk boundaries. final BAMFileIndexIterator iterator = new BAMFileIndexIterator(filePointers); // Add some preprocessing filters for edge-case reads that don't fit into this // query type. return new BAMQueryFilteringIterator(iterator, new BAMQueryMultipleIntervalsIteratorFilter(intervals, contained)); }
private CloseableIterator<SAMRecord> createIndexIterator(final QueryInterval[] intervals, final boolean contained) { assertIntervalsOptimized(intervals); BAMFileSpan span = getFileSpan(intervals, getIndex()); // Create an iterator over the above chunk boundaries. final BAMFileIndexIterator iterator = new BAMFileIndexIterator(span == null ? null : span.toCoordinateArray()); // Add some preprocessing filters for edge-case reads that don't fit into this // query type. return new BAMQueryFilteringIterator(iterator, new BAMQueryMultipleIntervalsIteratorFilter(intervals, contained)); }
private CloseableIterator<SAMRecord> createIndexIterator(final QueryInterval[] intervals, final boolean contained) { assertIntervalsOptimized(intervals); BAMFileSpan span = getFileSpan(intervals, getIndex()); // Create an iterator over the above chunk boundaries. final BAMFileIndexIterator iterator = new BAMFileIndexIterator(span == null ? null : span.toCoordinateArray()); // Add some preprocessing filters for edge-case reads that don't fit into this // query type. return new BAMQueryFilteringIterator(iterator, new BAMQueryMultipleIntervalsIteratorFilter(intervals, contained)); }
private CloseableIterator<SAMRecord> createIndexIterator(final QueryInterval[] intervals, final boolean contained) { assertIntervalsOptimized(intervals); BAMFileSpan span = getFileSpan(intervals, getIndex()); // Create an iterator over the above chunk boundaries. final BAMFileIndexIterator iterator = new BAMFileIndexIterator(span == null ? null : span.toCoordinateArray()); // Add some preprocessing filters for edge-case reads that don't fit into this // query type. return new BAMQueryFilteringIterator(iterator, new BAMQueryMultipleIntervalsIteratorFilter(intervals, contained)); }
@Test(dataProvider = "compareToFilter") public void testCompareToFilter( final QueryInterval[] query, final int refIndex, final int start, final int length, final boolean contained, final BAMIteratorFilter.FilteringIteratorState expectedState) { SAMRecord samRec = getSAMRecord(refIndex, start, length); BAMQueryMultipleIntervalsIteratorFilter it = new BAMQueryMultipleIntervalsIteratorFilter(query, contained); Assert.assertEquals(it.compareToFilter(samRec), expectedState); }