/** * Prepare to filter out SAMRecords that do not overlap the given list of intervals * @param intervals -- must be locus-ordered & non-overlapping */ public IntervalFilter(final List<Interval> intervals, final SAMFileHeader samHeader) { this.samHeader = samHeader; IntervalUtil.assertOrderedNonOverlapping(intervals.iterator(), samHeader.getSequenceDictionary()); this.intervals = intervals.iterator(); advanceInterval(); }
/** * Prepare to filter out SAMRecords that do not overlap the given list of intervals * @param intervals -- must be locus-ordered & non-overlapping */ public IntervalFilter(final List<Interval> intervals, final SAMFileHeader samHeader) { this.samHeader = samHeader; IntervalUtil.assertOrderedNonOverlapping(intervals.iterator(), samHeader.getSequenceDictionary()); this.intervals = intervals.iterator(); advanceInterval(); }
/** * Prepare to filter out SAMRecords that do not overlap the given list of intervals * @param intervals -- must be locus-ordered & non-overlapping */ public IntervalFilter(final List<Interval> intervals, final SAMFileHeader samHeader) { this.samHeader = samHeader; IntervalUtil.assertOrderedNonOverlapping(intervals.iterator(), samHeader.getSequenceDictionary()); this.intervals = intervals.iterator(); advanceInterval(); }
/** * Determines whether a SAMRecord matches this filter * * @param record the SAMRecord to evaluate * @return true if the SAMRecord matches the filter, otherwise false */ @Override public boolean filterOut(final SAMRecord record) { while (currentInterval != null && (currentSequenceIndex < record.getReferenceIndex() || (currentSequenceIndex == record.getReferenceIndex() && currentInterval.getEnd() < record.getAlignmentStart()))) { advanceInterval(); } // Return true if record should be filtered out return !(currentInterval != null && currentSequenceIndex == record.getReferenceIndex() && currentInterval.getStart() <= record.getAlignmentEnd()); }
/** * Determines whether a SAMRecord matches this filter * * @param record the SAMRecord to evaluate * @return true if the SAMRecord matches the filter, otherwise false */ public boolean filterOut(final SAMRecord record) { while (currentInterval != null && (currentSequenceIndex < record.getReferenceIndex() || (currentSequenceIndex == record.getReferenceIndex() && currentInterval.getEnd() < record.getAlignmentStart()))) { advanceInterval(); } // Return true if record should be filtered out return !(currentInterval != null && currentSequenceIndex == record.getReferenceIndex() && currentInterval.getStart() <= record.getAlignmentEnd()); }
/** * Determines whether a SAMRecord matches this filter * * @param record the SAMRecord to evaluate * @return true if the SAMRecord matches the filter, otherwise false */ @Override public boolean filterOut(final SAMRecord record) { while (currentInterval != null && (currentSequenceIndex < record.getReferenceIndex() || (currentSequenceIndex == record.getReferenceIndex() && currentInterval.getEnd() < record.getAlignmentStart()))) { advanceInterval(); } // Return true if record should be filtered out return !(currentInterval != null && currentSequenceIndex == record.getReferenceIndex() && currentInterval.getStart() <= record.getAlignmentEnd()); }