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 booleanprotected Stringprotected DbVcfprotected booleanprotected Stringprotected booleanstatic final intprotected Stringprotected booleanprotected booleanprotected booleanprotected booleanprotected org.snpeff.fileIterator.VcfFileIteratorprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanannotate(org.snpeff.vcf.VcfEntry vcfEntry) Annotate a VCF entryprotected booleanannotateExists(org.snpeff.vcf.VcfEntry vcfEntry) Add 'exists' flag to INFO fieldsprotected booleanannotateIds(org.snpeff.vcf.VcfEntry vcfEntry, Set<String> idSet) Add ID information.protected booleanannotateInfo(org.snpeff.vcf.VcfEntry vcfEntry, Map<String, String> info) Add INFO fields.voidclose()protected voidprotected voiddiscoverInfoFields(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 booleanShould we annotate using 'exists' field?protected voidfindDbId(Set<String> idSet, QueryResult qr) Find an ID for this variant and add them to idSetprotected StringfindDbInfo(String infoFieldName, QueryResult qr) Find all non-empty INFO fields 'infoFieldName' in resultsprotected voidfindDbInfo(Map<String, String> info, QueryResult qr) Find INFO fields for this VCF entryprotected StringfindDbInfoAlt(String infoFieldName, QueryResult qr) Find the first non-empty INFO field 'infoFieldName' in results Note: ALT must matchprotected voidfindDbInfoRef(Map<String, String> info, Set<org.snpeff.vcf.VcfEntry> uniqueVcfEntries) Fill values for INFO fields requiring 'REF' valueprotected booleanmatch(org.snpeff.interval.Variant var, org.snpeff.vcf.VariantVcfEntry dbEntry) Does database entry 'dbVcfEntry' match 'variant'?voidopen()protected StringprependInfoName(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'voidsetAnnotateEmpty(boolean annotateEmpty) voidsetDebug(boolean debug) voidsetExistsInfoField(String existsInfoField) voidsetInfoFields(boolean useInfoFields, Collection<String> infoFields) voidsetPrependInfoFieldName(String prependInfoFieldName) voidsetUseId(boolean useId) voidsetUseRefAlt(boolean useRefAlt) voidsetVerbose(boolean verbose) toString()protected StringIDs from database not present in VCFprotected voidShow 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)
-