Class VcfGenotype

java.lang.Object
org.snpeff.vcf.VcfGenotype

public class VcfGenotype extends Object
A VCF genotype field There is one genotype per sample in each VCF entry
Author:
pablocingolani
  • Field Details

  • Constructor Details

  • Method Details

    • add

      public void add(String name, String value)
      Add a name=value pair WARNING: This method does NOT change the FORMAT field. Use VcfEntry.addFormat() method
    • depth

      public int depth()
      Depth of coverage
      Returns:
      -1 if not found
    • get

      public String get(String fieldName)
      Get a genotype field
    • getGenotype

      public int[] getGenotype()
      Get genotype numbers as an array E.g. '0/1' -> {0, 1} WARNING: If the genotype is missing, the numeric value is '-1'. E.g.: './.' -> {-1, -1}
      Returns:
    • getGenotype

      public String getGenotype(int idx)
      Get genotype string by index WARNING: If the genotype is missing, it returns an empty string. E.g.: './.' -> getGenotype(0) = ""
      Returns:
    • getGenotypeCode

      public int getGenotypeCode()
      Return as a genotype SNP code: -1: if missing data of more than one ALT 0: if aa (0/0) 1: if Aa (0/1 or 1/0) 2: if AA (1/1) WARNING: In multi-allelic case, any non-ref is treated as ALT
      Returns:
    • getGenotypeCodeIgnoreMissing

      public int getGenotypeCodeIgnoreMissing()
      Return as a genotype SNP code: 0: if aa (0/0) or any missing value 1: if Aa (0/1 or 1/0) 2: if AA (1/1)
      Returns:
    • getGenotypeStr

      public String getGenotypeStr()
      Return genotypes as string (e.g. "A/C")
      Returns:
    • getVcfEntry

      public VcfEntry getVcfEntry()
    • isHeterozygous

      public boolean isHeterozygous()
      Is the most likely genotype heterozygous?
      Returns:
    • isHomozygous

      public boolean isHomozygous()
      Is this genotype homozygous? (either REF or ALT)
    • isHomozygousAlt

      public boolean isHomozygousAlt()
      Is this genotype homozygous ALT?
    • isMissing

      public boolean isMissing()
      Is genotpye missing (e.g. "GT=./.")
      Returns:
    • isPhased

      public boolean isPhased()
    • isRef

      public boolean isRef()
      Is any genotype different than REF? Note: This is calculated for the most likely genotype (GT field)
    • isVariant

      public boolean isVariant()
      Is any genotype different than REF? Note: This is calculated for the most likely genotype (GT field)
    • plodity

      public int plodity()
      Genotype plodity (i.e. how many copies of the chromosome does it have)
    • set

      public void set(String gtFieldName, String gtValue)
      Set a genotype field value
    • setGenotype

      public void setGenotype(String gtValue)
      Set genotype value
    • toString

      public String toString()
      Overrides:
      toString in class Object