Class AnnotateVcfDb

java.lang.Object
org.snpsift.annotate.AnnotateVcfDb
Direct Known Subclasses:
AnnotateVcfDbMem, AnnotateVcfDbSorted, AnnotateVcfDbTabix

public abstract class AnnotateVcfDb extends Object
Annotate using a VCF "database"
Author:
pcingola
  • 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

      protected String chrPrev
    • existsInfoField

      protected String existsInfoField
    • prependInfoFieldName

      protected String prependInfoFieldName
    • dbVcf

      protected DbVcf dbVcf
    • vcfDbFile

      protected org.snpeff.fileIterator.VcfFileIterator vcfDbFile
    • errCount

      protected HashMap<String,Integer> errCount
    • infoFields

      protected Set<String> infoFields
    • vcfInfoPerAllele

      protected Map<String,Boolean> vcfInfoPerAllele
    • vcfInfoPerAlleleRef

      protected Map<String,Boolean> vcfInfoPerAlleleRef
  • Constructor Details

    • AnnotateVcfDb

      public AnnotateVcfDb()
  • Method Details

    • annotate

      public boolean annotate(org.snpeff.vcf.VcfEntry vcfEntry) throws IOException
      Annotate a VCF entry
      Throws:
      IOException
    • annotateExists

      protected boolean annotateExists(org.snpeff.vcf.VcfEntry vcfEntry)
      Add 'exists' flag to INFO fields
    • annotateIds

      protected boolean annotateIds(org.snpeff.vcf.VcfEntry vcfEntry, Set<String> idSet)
      Add ID information. Make sure we are no repeating IDs
    • annotateInfo

      protected boolean annotateInfo(org.snpeff.vcf.VcfEntry vcfEntry, Map<String,String> info)
      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

      public List<org.snpeff.vcf.VcfEntry> find(org.snpeff.interval.Variant var)
    • find

      public List<org.snpeff.vcf.VcfEntry> find(org.snpeff.vcf.VcfEntry vcfEntry)
      Find matching entries in the database
    • findDbExists

      protected boolean findDbExists(QueryResult qr)
      Should we annotate using 'exists' field?
    • findDbId

      protected void findDbId(Set<String> idSet, QueryResult qr)
      Find an ID for this variant and add them to idSet
    • findDbInfo

      protected void findDbInfo(Map<String,String> info, QueryResult qr)
      Find INFO fields for this VCF entry
    • findDbInfo

      protected String findDbInfo(String infoFieldName, QueryResult qr)
      Find all non-empty INFO fields 'infoFieldName' in results
    • findDbInfoAlt

      protected String findDbInfoAlt(String infoFieldName, QueryResult qr)
      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

      protected String prependInfoName(String infoStr)
      Prepend 'prependInfoFieldName' to all info fields
    • query

      protected Collection<org.snpeff.vcf.VariantVcfEntry> query(org.snpeff.interval.Variant variant)
      Query database and find results matching 'variant'
    • setAnnotateEmpty

      public void setAnnotateEmpty(boolean annotateEmpty)
    • setDebug

      public void setDebug(boolean debug)
    • setExistsInfoField

      public void setExistsInfoField(String existsInfoField)
    • setInfoFields

      public void setInfoFields(boolean useInfoFields, Collection<String> infoFields)
    • setPrependInfoFieldName

      public void setPrependInfoFieldName(String prependInfoFieldName)
    • setUseId

      public void setUseId(boolean useId)
    • setUseRefAlt

      public void setUseRefAlt(boolean useRefAlt)
    • setVerbose

      public void setVerbose(boolean verbose)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • uniqueIds

      protected String uniqueIds(Set<String> idSetDb, String idStrVcf)
      IDs from database not present in VCF
    • warn

      protected void warn(String warn)
      Show a warning message (up to MAX_ERRORS times)