Package htsjdk.beta.codecs.variants.vcf

# Class VCFDecoder

java.lang.Object
htsjdk.beta.codecs.variants.vcf.VCFDecoder

All Implemented Interfaces:
  `HtsDecoder<VCFHeader,VariantContext>`, `HtsQuery<VariantContext>`, `VariantsDecoder`, `Closeable`, `AutoCloseable`, `Iterable<VariantContext>`

Direct Known Subclasses:
  `VCFDecoderV3_2`, `VCFDecoderV3_3`, `VCFDecoderV4_0`, `VCFDecoderV4_1`, `VCFDecoderV4_2`, `VCFDecoderV4_3`

@InternalAPI public abstract class VCFDecoder extends Object implements VariantsDecoder
InternalAPII Base class for concrete implementations of `HtsContentType.VARIANT_CONTEXTS` decoders.

## Constructor Summary

Constructors
Constructor
Description
`VCFDecoder(Bundle inputBundle, AbstractVCFCodec vcfCodec, VariantsDecoderOptions variantsDecoderOptions)`
InternalAPI Create a new VCF decoder.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Close any resources associated with this decoder.
`final String`
`getDisplayName()`
Get a user-friendly display name for this decoder.
`final String`
`getFileFormat()`
Get the name of the file format supported by this decoder.The format name defines the underlying format handled by this decoder, and also corresponds to the format of the primary bundle resource that is required when decoding (see `BundleResourceType` and `BundleResource.getFileFormat()`).
`VCFHeader`
`getHeader()`
Get the file header for this decoder.
`Bundle`
`getInputBundle()`
Get the input `Bundle` for this decoder.
`VariantsDecoderOptions`
`getReadsDecoderOptions()`
Get the `VariantsDecoderOptions` for this decoder.
`boolean`
`hasIndex()`
Return true if the underlying resource has an index.
`boolean`
`isQueryable()`
Gte true if the underlying resource is queryable.
`CloseableIterator<VariantContext>`
`iterator()`
Get an iterator of all records in the underlying resource.
`CloseableIterator<VariantContext>`
`query(String queryString)`
Get an iterator over all records from the underlying resource that match the query string
`CloseableIterator<VariantContext>`
`query(List<HtsInterval> intervals, HtsQueryRule queryRule)`
Get an iterator over all records from the underlying resource that match the query arguments.
`CloseableIterator<VariantContext>`
`queryStart(String queryName, long start)`
Get an iterator over all records from the underlying resource that overlap the start position

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

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

### Methods inherited from interface htsjdk.beta.plugin.HtsDecoder

`getVersion`

### Methods inherited from interface htsjdk.beta.plugin.interval.HtsQuery

`query, query, queryContained, queryContained, queryContained, queryOverlapping, queryOverlapping, queryOverlapping`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Constructor Details

### VCFDecoder

@InternalAPI public VCFDecoder(Bundle inputBundle, AbstractVCFCodec vcfCodec, VariantsDecoderOptions variantsDecoderOptions)
InternalAPI Create a new VCF decoder.

Parameters:
  `inputBundle` - the input `Bundle` to decode
  `vcfCodec` - the `AbstractVCFCodec` to use for this decoder
  `variantsDecoderOptions` - the `VariantsDecoderOptions` for this decoder

## Method Details

### getFileFormat

public final String getFileFormat()
Description copied from interface: `HtsDecoder`
Get the name of the file format supported by this decoder.The format name defines the underlying format handled by this decoder, and also corresponds to the format of the primary bundle resource that is required when decoding (see `BundleResourceType` and `BundleResource.getFileFormat()`).

Specified by:
  `getFileFormat` in interface `HtsDecoder<VCFHeader,VariantContext>`
Returns:
  the name of the underlying file format handled by this decoder

### getDisplayName

public final String getDisplayName()
Description copied from interface: `HtsDecoder`
Get a user-friendly display name for this decoder.

Specified by:
  `getDisplayName` in interface `HtsDecoder<VCFHeader,VariantContext>`
Returns:
  a user-friendly display name for this decoder for use in error and warning messages

### getHeader

public VCFHeader getHeader()
Description copied from interface: `HtsDecoder`
Get the file header for this decoder.

Specified by:
  `getHeader` in interface `HtsDecoder<VCFHeader,VariantContext>`
Returns:
  the file header for this decoder, of type `H`

### iterator

public CloseableIterator<VariantContext> iterator()
Description copied from interface: `HtsQuery`
Get an iterator of all records in the underlying resource.

Specified by:
  `iterator` in interface `HtsQuery<VariantContext>`
Specified by:
  `iterator` in interface `Iterable<VariantContext>`
Returns:
  an iterator of all records in the underlying resource

### isQueryable

public boolean isQueryable()
Description copied from interface: `HtsQuery`
Gte true if the underlying resource is queryable.

Specified by:
  `isQueryable` in interface `HtsQuery<VariantContext>`
Returns:
  true if the underlying resource is queryable. this may be true even if the underlying resource returns false for `HtsQuery.hasIndex()`

### hasIndex

public boolean hasIndex()
Description copied from interface: `HtsQuery`
Return true if the underlying resource has an index.

Specified by:
  `hasIndex` in interface `HtsQuery<VariantContext>`
Returns:
  true if the underlying resource has an index

### query

public CloseableIterator<VariantContext> query(List<HtsInterval> intervals, HtsQueryRule queryRule)
Description copied from interface: `HtsQuery`
Get an iterator over all records from the underlying resource that match the query arguments. Callers much ensure that the intervals are in increasing order and do not overlap or abut.

Specified by:
  `query` in interface `HtsQuery<VariantContext>`
Parameters:
  `intervals` - list of intervals to match
  `queryRule` - query rule to use, from `HtsQueryRule`
Returns:
  an iterator over all records from the underlying resource that match the query arguments

### query

public CloseableIterator<VariantContext> query(String queryString)
Description copied from interface: `HtsQuery`
Get an iterator over all records from the underlying resource that match the query string

Specified by:
  `query` in interface `HtsQuery<VariantContext>`
Parameters:
  `queryString` - decoder specific query string
Returns:
  an iterator over all records from the underlying resource that match the query string

### queryStart

public CloseableIterator<VariantContext> queryStart(String queryName, long start)
Description copied from interface: `HtsQuery`
Get an iterator over all records from the underlying resource that overlap the start position

Specified by:
  `queryStart` in interface `HtsQuery<VariantContext>`
Parameters:
  `queryName` - name to match
  `start` - start position to overlap
Returns:
  an iterator over all records from the underlying resource that overlap the start position

### close

public void close()
Description copied from interface: `HtsDecoder`
Close any resources associated with this decoder.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `HtsDecoder<VCFHeader,VariantContext>`

### getInputBundle

public Bundle getInputBundle()
Get the input `Bundle` for this decoder.

Returns:
  the input `Bundle` for this decoder

### getReadsDecoderOptions

public VariantsDecoderOptions getReadsDecoderOptions()
Get the `VariantsDecoderOptions` for this decoder.

Returns:
  the `VariantsDecoderOptions` for this decoder.