# Interface VCFReader

All Superinterfaces:
  `AutoCloseable, Closeable, Iterable<VariantContext>`

All Known Implementing Classes:
  `VCFFileReader`

public interface VCFReader extends Closeable, Iterable<VariantContext>
Interface for reading VCF/BCF files.

## Method Summary

Modifier and Type
Method
Description
`VCFHeader`
`getHeader()`
Returns the VCFHeader associated with this VCFReader.
`boolean`
`isQueryable()`
A method to check if the reader is query-able, i.e.
`CloseableIterator<VariantContext>`
`iterator()`
`default CloseableIterator<VariantContext>`
`query(Locatable locatable)`
Queries for records overlapping the `Locatable` specified.
`CloseableIterator<VariantContext>`
`query(String chrom, int start, int end)`
Queries for records overlapping the region specified.

### Methods inherited from interface Closeable

`close`

### Methods inherited from interface Iterable

`forEach, spliterator`

## Method Details

### getHeader

VCFHeader getHeader()
Returns the VCFHeader associated with this VCFReader.

### query

CloseableIterator<VariantContext> query(String chrom, int start, int end)
Queries for records overlapping the region specified. Note that this method requires VCF files with an associated index. If no index exists a TribbleException will be thrown.

Parameters:
  `chrom` - the chomosome to query
  `start` - query interval start
  `end` - query interval end
Returns:
  non-null iterator over VariantContexts

### query

default CloseableIterator<VariantContext> query(Locatable locatable)
Queries for records overlapping the `Locatable` specified. Note that this method requires VCF files with an associated index. If no index exists a TribbleException will be thrown.

Returns:
  non-null iterator over VariantContexts

### isQueryable

boolean isQueryable()
A method to check if the reader is query-able, i.e. if a call to `VCFFileReader.query(String, int, int)` can be successful

Returns:
  true if the reader can be queried, i.e. if the underlying Tribble reader is queryable.

### iterator

CloseableIterator<VariantContext> iterator()

Specified by:
  `iterator` in interface `Iterable<VariantContext>`