Package htsjdk.samtools.filter
Class TagFilter
- java.lang.Object
-
- htsjdk.samtools.filter.TagFilter
-
- All Implemented Interfaces:
SamRecordFilter
public class TagFilter extends Object implements SamRecordFilter
Filter class for matching tag attributes in SAMRecords $Id$
-
-
Constructor Summary
Constructors Constructor Description TagFilter(String tag, Object value)
Constructor for a single valueTagFilter(String tag, Object value, Boolean includeReads)
Constructor for a single valueTagFilter(String tag, List<Object> values)
Constructor for multiple valuesTagFilter(String tag, List<Object> values, Boolean includeReads)
Constructor for multiple values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
filterOut(SAMRecord record)
Determines whether a SAMRecord matches this filterboolean
filterOut(SAMRecord first, SAMRecord second)
Determines whether a paired of SAMRecord matches this filter
-
-
-
Constructor Detail
-
TagFilter
public TagFilter(String tag, Object value)
Constructor for a single value- Parameters:
tag
- the key of the tag to matchvalue
- the value to match
-
TagFilter
public TagFilter(String tag, List<Object> values)
Constructor for multiple values- Parameters:
tag
- the key of the tag to matchvalues
- the matching values
-
TagFilter
public TagFilter(String tag, Object value, Boolean includeReads)
Constructor for a single value- Parameters:
tag
- the key of the tag to matchvalue
- the value to matchincludeReads
- whether to include or not include reads that match filter
-
-
Method Detail
-
filterOut
public boolean filterOut(SAMRecord record)
Determines whether a SAMRecord matches this filter- Specified by:
filterOut
in interfaceSamRecordFilter
- Parameters:
record
- the SAMRecord to evaluate- Returns:
- the XOR of SAMRecord matches the filter and includeReads.
-
filterOut
public boolean filterOut(SAMRecord first, SAMRecord second)
Determines whether a paired 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 includeReads is true and neither SAMRecord matches filter true if includeReads is false and both SAMRecords match filter otherwise false
-
-