# Class FilterApplyingVariantIterator

java.lang.Object
picard.vcf.filter.FilterApplyingVariantIterator

All Implemented Interfaces:
  `htsjdk.samtools.util.CloseableIterator<htsjdk.variant.variantcontext.VariantContext>, Closeable, AutoCloseable, Iterator<htsjdk.variant.variantcontext.VariantContext>`

public class FilterApplyingVariantIterator extends Object implements htsjdk.samtools.util.CloseableIterator<htsjdk.variant.variantcontext.VariantContext>
Iterator that dynamically applies filter strings to VariantContext records supplied by an underlying iterator. Returns all records from the underlying stream and does not remove any.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ALL_GTS_FILTERED`
Filter string that is used to filter a Variant when all variant genotypes are filtered out.
`static final String`
`PASS_FILTER`
The "PASS"ing filter String.

## Constructor Summary

Constructors
Constructor
Description
`FilterApplyingVariantIterator(Iterator<htsjdk.variant.variantcontext.VariantContext> iterator, Collection<VariantFilter> filters, Collection<GenotypeFilter> gtFilters)`
Constructs an iterator from an underlying iterator and the provided (possibly empty) collections of variant and genotype filters.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`boolean`
`hasNext()`
`htsjdk.variant.variantcontext.VariantContext`
`next()`
Provides the next record from the underlying iterator after applying filter strings generated by the set of filters in use by the iterator.
`void`
`remove()`

### Methods inherited from class Object

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

### Methods inherited from interface htsjdk.samtools.util.CloseableIterator

`stream, toList`

### Methods inherited from interface Iterator

`forEachRemaining`

## Field Details

### ALL_GTS_FILTERED

public static final String ALL_GTS_FILTERED
Filter string that is used to filter a Variant when all variant genotypes are filtered out.

See Also:
  - Constant Field Values

### PASS_FILTER

public static final String PASS_FILTER
The "PASS"ing filter String.

See Also:
  - Constant Field Values

## Constructor Details

### FilterApplyingVariantIterator

public FilterApplyingVariantIterator(Iterator<htsjdk.variant.variantcontext.VariantContext> iterator, Collection<VariantFilter> filters, Collection<GenotypeFilter> gtFilters)
Constructs an iterator from an underlying iterator and the provided (possibly empty) collections of variant and genotype filters.

## Method Details

### next

public htsjdk.variant.variantcontext.VariantContext next()
Provides the next record from the underlying iterator after applying filter strings generated by the set of filters in use by the iterator.

Specified by:
  `next` in interface `Iterator<htsjdk.variant.variantcontext.VariantContext>`

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<htsjdk.variant.variantcontext.VariantContext>`

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `htsjdk.samtools.util.CloseableIterator<htsjdk.variant.variantcontext.VariantContext>`

### remove

public void remove()

Specified by:
  `remove` in interface `Iterator<htsjdk.variant.variantcontext.VariantContext>`