public class VCFFileReader extends java.lang.Object implements java.io.Closeable, java.lang.Iterable<VariantContext>
Constructor and Description |
---|
VCFFileReader(java.io.File file)
Constructs a VCFFileReader that requires the index to be present.
|
VCFFileReader(java.io.File file,
boolean requireIndex)
Allows construction of a VCFFileReader that will or will not assert the presence of an index as desired.
|
VCFFileReader(java.io.File file,
java.io.File indexFile)
Constructs a VCFFileReader with a specified index.
|
VCFFileReader(java.io.File file,
java.io.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(java.io.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(java.io.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(java.io.File file)
Returns the SAMSequenceDictionary from the provided VCF file.
|
static boolean |
isBCF(java.io.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(java.lang.String chrom,
int start,
int end)
Queries for records within the region specified.
|
public VCFFileReader(java.io.File file)
public VCFFileReader(java.io.File file, java.io.File indexFile)
public VCFFileReader(java.io.File file, boolean requireIndex)
public VCFFileReader(java.io.File file, java.io.File indexFile, boolean requireIndex)
public static boolean isBCF(java.io.File file)
public static SAMSequenceDictionary getSequenceDictionary(java.io.File file)
public static IntervalList fromVcf(java.io.File file)
file
- public static IntervalList fromVcf(java.io.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 java.lang.Iterable<VariantContext>
public CloseableIterator<VariantContext> query(java.lang.String chrom, int start, int end)
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable