Package org.snpsift.annotate
Class AnnotateVcfDb
java.lang.Object
org.snpsift.annotate.AnnotateVcfDb
- Direct Known Subclasses:
AnnotateVcfDbMem
,AnnotateVcfDbSorted
,AnnotateVcfDbTabix
Annotate using a VCF "database"
- Author:
- pcingola
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected String
protected DbVcf
protected boolean
protected String
protected boolean
static final int
protected String
protected boolean
protected boolean
protected boolean
protected boolean
protected org.snpeff.fileIterator.VcfFileIterator
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
annotate
(org.snpeff.vcf.VcfEntry vcfEntry) Annotate a VCF entryprotected boolean
annotateExists
(org.snpeff.vcf.VcfEntry vcfEntry) Add 'exists' flag to INFO fieldsprotected boolean
annotateIds
(org.snpeff.vcf.VcfEntry vcfEntry, Set<String> idSet) Add ID information.protected boolean
annotateInfo
(org.snpeff.vcf.VcfEntry vcfEntry, Map<String, String> info) Add INFO fields.void
close()
protected void
protected void
discoverInfoFields
(org.snpeff.vcf.VcfEntry dbVcfEntry) If 'ALL' info fields are being used, we can try to discover new fields that have not already been added to the annotation list (e.g.List
<org.snpeff.vcf.VcfEntry> find
(org.snpeff.interval.Variant var) List
<org.snpeff.vcf.VcfEntry> find
(org.snpeff.vcf.VcfEntry vcfEntry) Find matching entries in the databaseprotected boolean
Should we annotate using 'exists' field?protected void
findDbId
(Set<String> idSet, QueryResult qr) Find an ID for this variant and add them to idSetprotected String
findDbInfo
(String infoFieldName, QueryResult qr) Find all non-empty INFO fields 'infoFieldName' in resultsprotected void
findDbInfo
(Map<String, String> info, QueryResult qr) Find INFO fields for this VCF entryprotected String
findDbInfoAlt
(String infoFieldName, QueryResult qr) Find the first non-empty INFO field 'infoFieldName' in results Note: ALT must matchprotected void
findDbInfoRef
(Map<String, String> info, Set<org.snpeff.vcf.VcfEntry> uniqueVcfEntries) Fill values for INFO fields requiring 'REF' valueprotected boolean
match
(org.snpeff.interval.Variant var, org.snpeff.vcf.VariantVcfEntry dbEntry) Does database entry 'dbVcfEntry' match 'variant'?void
open()
protected String
prependInfoName
(String infoStr) Prepend 'prependInfoFieldName' to all info fieldsprotected Collection
<org.snpeff.vcf.VariantVcfEntry> query
(org.snpeff.interval.Variant variant) Query database and find results matching 'variant'void
setAnnotateEmpty
(boolean annotateEmpty) void
setDebug
(boolean debug) void
setExistsInfoField
(String existsInfoField) void
setInfoFields
(boolean useInfoFields, Collection<String> infoFields) void
setPrependInfoFieldName
(String prependInfoFieldName) void
setUseId
(boolean useId) void
setUseRefAlt
(boolean useRefAlt) void
setVerbose
(boolean verbose) toString()
protected String
IDs from database not present in VCFprotected void
Show a warning message (up to MAX_ERRORS times)
-
Field Details
-
MAX_ERRORS
public static final int MAX_ERRORS- See Also:
-
verbose
protected boolean verbose -
debug
protected boolean debug -
annotateEmpty
protected boolean annotateEmpty -
hasVcfInfoPerAlleleRef
protected boolean hasVcfInfoPerAlleleRef -
useId
protected boolean useId -
useInfoFields
protected boolean useInfoFields -
useAllInfoFields
protected boolean useAllInfoFields -
useRefAlt
protected boolean useRefAlt -
chrPrev
-
existsInfoField
-
prependInfoFieldName
-
dbVcf
-
vcfDbFile
protected org.snpeff.fileIterator.VcfFileIterator vcfDbFile -
errCount
-
infoFields
-
vcfInfoPerAllele
-
vcfInfoPerAlleleRef
-
-
Constructor Details
-
AnnotateVcfDb
public AnnotateVcfDb()
-
-
Method Details
-
annotate
Annotate a VCF entry- Throws:
IOException
-
annotateExists
protected boolean annotateExists(org.snpeff.vcf.VcfEntry vcfEntry) Add 'exists' flag to INFO fields -
annotateIds
Add ID information. Make sure we are no repeating IDs -
annotateInfo
Add INFO fields. -
close
public void close() -
discoverInfoFields
protected void discoverInfoFields() -
discoverInfoFields
protected void discoverInfoFields(org.snpeff.vcf.VcfEntry dbVcfEntry) If 'ALL' info fields are being used, we can try to discover new fields that have not already been added to the annotation list (e.g. implicit fields not mentioned in the VCF header) -
find
-
find
Find matching entries in the database -
findDbExists
Should we annotate using 'exists' field? -
findDbId
Find an ID for this variant and add them to idSet -
findDbInfo
Find INFO fields for this VCF entry -
findDbInfo
Find all non-empty INFO fields 'infoFieldName' in results -
findDbInfoAlt
Find the first non-empty INFO field 'infoFieldName' in results Note: ALT must match -
findDbInfoRef
protected void findDbInfoRef(Map<String, String> info, Set<org.snpeff.vcf.VcfEntry> uniqueVcfEntries) Fill values for INFO fields requiring 'REF' value -
match
protected boolean match(org.snpeff.interval.Variant var, org.snpeff.vcf.VariantVcfEntry dbEntry) Does database entry 'dbVcfEntry' match 'variant'? -
open
public void open() -
prependInfoName
Prepend 'prependInfoFieldName' to all info fields -
query
Query database and find results matching 'variant' -
setAnnotateEmpty
public void setAnnotateEmpty(boolean annotateEmpty) -
setDebug
public void setDebug(boolean debug) -
setExistsInfoField
-
setInfoFields
-
setPrependInfoFieldName
-
setUseId
public void setUseId(boolean useId) -
setUseRefAlt
public void setUseRefAlt(boolean useRefAlt) -
setVerbose
public void setVerbose(boolean verbose) -
toString
-
uniqueIds
IDs from database not present in VCF -
warn
Show a warning message (up to MAX_ERRORS times)
-