public class VCFFileReader extends Object implements Closeable, Iterable<VariantContext>
| Constructor and Description |
|---|
VCFFileReader(File file)
Constructs a VCFFileReader that requires the index to be present.
|
VCFFileReader(File file,
boolean requireIndex)
Allows construction of a VCFFileReader that will or will not assert the presence of an index as desired.
|
VCFFileReader(File file,
File indexFile)
Constructs a VCFFileReader with a specified index.
|
VCFFileReader(File file,
File indexFile,
boolean requireIndex)
Allows construction of a VCFFileReader with a specified index file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static IntervalList |
fromVcf(File file)
Parse a VCF file and convert to an IntervalList The name field of the IntervalList is taken from the ID field of the variant, if it exists.
|
static IntervalList |
fromVcf(File file,
boolean includeFiltered) |
static IntervalList |
fromVcf(VCFFileReader vcf)
Converts a vcf to an IntervalList.
|
static IntervalList |
fromVcf(VCFFileReader vcf,
boolean includeFiltered) |
VCFHeader |
getFileHeader()
Returns the VCFHeader associated with this VCF/BCF file.
|
static SAMSequenceDictionary |
getSequenceDictionary(File file)
Returns the SAMSequenceDictionary from the provided VCF file.
|
static boolean |
isBCF(File file)
Returns true if the given file appears to be a BCF file.
|
CloseableIterator<VariantContext> |
iterator()
Returns an iterator over all records in this VCF/BCF file.
|
CloseableIterator<VariantContext> |
query(String chrom,
int start,
int end)
Queries for records within the region specified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic VCFFileReader(File file)
public VCFFileReader(File file, File indexFile)
public VCFFileReader(File file, boolean requireIndex)
public static boolean isBCF(File file)
public static SAMSequenceDictionary getSequenceDictionary(File file)
public static IntervalList fromVcf(File file)
file - public static IntervalList fromVcf(File file, boolean includeFiltered)
public static IntervalList fromVcf(VCFFileReader vcf)
vcf - the vcfReader to be used for the conversionpublic static IntervalList fromVcf(VCFFileReader vcf, boolean includeFiltered)
public VCFHeader getFileHeader()
public CloseableIterator<VariantContext> iterator()
iterator in interface Iterable<VariantContext>public CloseableIterator<VariantContext> query(String chrom, int start, int end)
public void close()
close in interface Closeableclose in interface AutoCloseable