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 value
`TagFilter(String tag, Object value, Boolean includeReads)`
Constructor for a single value
`TagFilter(String tag, List<Object> values)`
Constructor for multiple values
`TagFilter(String tag, List<Object> values, Boolean includeReads)`
Constructor for multiple values

## Method Summary

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 paired of SAMRecord matches this filter

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TagFilter

public TagFilter(String tag, Object value)
Constructor for a single value

Parameters:
  `tag` - the key of the tag to match
  `value` - the value to match

### TagFilter

public TagFilter(String tag, List<Object> values)
Constructor for multiple values

Parameters:
  `tag` - the key of the tag to match
  `values` - 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 match
  `value` - the value to match
  `includeReads` - whether to include or not include reads that match filter

### TagFilter

public TagFilter(String tag, List<Object> values, Boolean includeReads)
Constructor for multiple values

Parameters:
  `tag` - the key of the tag to match
  `values` - the matching values
  `includeReads` - whether to include or not include reads that match filter

## Method Details

### filterOut

public boolean filterOut(SAMRecord record)
Determines whether a SAMRecord matches this filter

Specified by:
  `filterOut` in interface `SamRecordFilter`
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 interface `SamRecordFilter`
Parameters:
  `first` - the first SAMRecord to evaluate
  `second` - 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