Package htsjdk.samtools.filter
Class IntervalKeepPairFilter
- java.lang.Object
-
- htsjdk.samtools.filter.IntervalKeepPairFilter
-
- All Implemented Interfaces:
SamRecordFilter
public class IntervalKeepPairFilter extends Object implements SamRecordFilter
Filter out SAMRecords where neither record of a pair overlaps a given set of intervals. If one record of a pair overlaps the interval list, than both are kept. It is required that the SAMRecords are passed in coordinate order, have non-null SAMFileHeaders, and that Mate Cigar (MC) is present.
-
-
Constructor Summary
Constructors Constructor Description IntervalKeepPairFilter(List<Interval> intervals)
Prepare to filter out SAMRecords that do not overlap the given list of intervals
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
filterOut(SAMRecord record)
Determines whether a SAMRecord matches this filter.boolean
filterOut(SAMRecord first, SAMRecord second)
Determines whether a pair of SAMRecord matches this filter
-
-
-
Method Detail
-
filterOut
public boolean filterOut(SAMRecord record)
Determines whether a SAMRecord matches this filter. Takes record, finds the location of its mate using the MC tag. Checks if either record overlaps the current interval using overlap detector. If yes, return false -> don't filter it out. If a read is secondary, supplementary, or single ended, filter read out. UseIntervalFilter
if you want to keep these reads, but NOTE: the resulting bam may not be valid.- Specified by:
filterOut
in interfaceSamRecordFilter
- Parameters:
record
- the SAMRecord to evaluate- Returns:
- true if the SAMRecord matches the filter, otherwise false
-
filterOut
public boolean filterOut(SAMRecord first, SAMRecord second)
Determines whether a pair of SAMRecord matches this filter- Specified by:
filterOut
in interfaceSamRecordFilter
- Parameters:
first
- the first SAMRecord to evaluatesecond
- the second SAMRecord to evaluate- Returns:
- true if both SAMRecords do not overlap the interval list
-
-