picard.vcf.filter

## 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 and Description
    --- | ---
    `static String` | `ALL_GTS_FILTERED` Filter string that is used to filter a Variant when all variant genotypes are filtered out.
    `static String` | `PASS_FILTER` The "PASS"ing filter String.

  - ### Constructor Summary

    Constructors
    Constructor and 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 java.lang.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 java.util.Iterator

      `forEachRemaining`

- - ### Field Detail

    - #### 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 Detail

    - #### 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 Detail

    - #### 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 `htsjdk.samtools.util.CloseableIterator<htsjdk.variant.variantcontext.VariantContext>`
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`

    - #### remove

          public void remove()

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