Package htsjdk.variant.vcf
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
All Methods Instance Methods Abstract Methods Default Methods 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 theLocatable
specified.CloseableIterator<VariantContext>
query(String chrom, int start, int end)
Queries for records overlapping the region specified.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
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 querystart
- query interval startend
- query interval end- Returns:
- non-null iterator over VariantContexts
-
query
default CloseableIterator<VariantContext> query(Locatable locatable)
Queries for records overlapping theLocatable
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 toVCFFileReader.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 interfaceIterable<VariantContext>
-
-