Package org.snpsift.annotate
Class DbVcf
java.lang.Object
org.snpsift.annotate.DbVcf
- All Implemented Interfaces:
DbMarker<org.snpeff.interval.Variant,org.snpeff.vcf.VariantVcfEntry>
- Direct Known Subclasses:
DbVcfMem,DbVcfSorted,DbVcfTabix
public abstract class DbVcf
extends Object
implements DbMarker<org.snpeff.interval.Variant,org.snpeff.vcf.VariantVcfEntry>
Use a VCF file as a database for annotations
A VCF database consists of a VCF file and an index.
When a query is made, the index is used to quickly get the file positions
where matching VCF entries are. File is read, entries are parsed and returned
as query() result.
WARNING: VcfEntry may hold multiple variants (e.g. multi-allelic VcfEntries). So
we index by variant and return all matching vcfEntries for
a given variant. This is why we use 'VariantVcfEntry' as opposed
to 'VcfEntry'
Notes:
If another query matches the same region of the file, then we could use
some sort of caching to speed up the process.
If the same file region is matched multiple times by successive
queries, creating an intervalTree from the VCF entries matching the region
might be effective
- Author:
- pcingola
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanprotected org.snpeff.vcf.VcfHeaderprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Close database, free resourcesorg.snpeff.vcf.VcfHeaderabstract voidopen()Open database (load index in memory if required)abstract Collection<org.snpeff.vcf.VariantVcfEntry> query(org.snpeff.interval.Variant variant) Find matching entries in the databasevoidsetDebug(boolean debug) voidsetVerbose(boolean verbose)
-
Field Details
-
debug
protected boolean debug -
verbose
protected boolean verbose -
dbFileName
-
vcfHeader
protected org.snpeff.vcf.VcfHeader vcfHeader
-
-
Constructor Details
-
DbVcf
-
-
Method Details
-
close
public abstract void close()Description copied from interface:DbMarkerClose database, free resources -
getVcfHeader
public org.snpeff.vcf.VcfHeader getVcfHeader() -
open
public abstract void open()Description copied from interface:DbMarkerOpen database (load index in memory if required) -
query
public abstract Collection<org.snpeff.vcf.VariantVcfEntry> query(org.snpeff.interval.Variant variant) Find matching entries in the database -
setDebug
public void setDebug(boolean debug) -
setVerbose
public void setVerbose(boolean verbose) - Specified by:
setVerbosein interfaceDbMarker<org.snpeff.interval.Variant,org.snpeff.vcf.VariantVcfEntry>
-