Package vcf

Class LowMafDiallelicGTRec

java.lang.Object
vcf.LowMafDiallelicGTRec
All Implemented Interfaces:
IntArray, GTRec

public final class LowMafDiallelicGTRec extends Object implements GTRec

Class LowMafDiallelicGTRc stores genotypes for a list of samples at a diallelic marker. Instances of class LowMafGTRec store lists of haplotypes carrying the minor or missing allele. All genotypes are considered to be unphased if any sample has an unphased or missing genotype.

Instances of class LowMafDiallelicGTRec are immutable.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new LowMafDiallelicGTRec representing the specified VCF record's GT format field data.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    alleleCount(int allele)
    Returns the number of copies of the specified allele.
    int
    get(int hap)
    Returns the specified allele for the specified haplotype or -1 if the allele is missing.
    boolean
    Returns true if every genotype for each sample is a phased, non-missing genotype, and returns false otherwise.
    boolean
    isPhased(int sample)
    Returns true if the genotype for the specified sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returns false otherwise.
    int
    Returns the major allele.
    Returns the marker.
    Returns the list of samples.
    int
    Returns the number of haplotypes.
    Returns the data represented by this as a VCF record with a GT format field.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LowMafDiallelicGTRec

      public LowMafDiallelicGTRec(VcfRecGTParser.HapListRep listRep)
      Constructs a new LowMafDiallelicGTRec representing the specified VCF record's GT format field data.
      Parameters:
      listRep - the VCF record genotype data
      Throws:
      IllegalArgumentException - if listRep.marker().nAlleles() != 2
      NullPointerException - if listRep == null
  • Method Details

    • isPhased

      public boolean isPhased(int sample)
      Description copied from interface: GTRec
      Returns true if the genotype for the specified sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returns false otherwise.
      Specified by:
      isPhased in interface GTRec
      Parameters:
      sample - a sample index
      Returns:
      true if the genotype for the specified sample is a phased, nonmissing genotype
    • isPhased

      public boolean isPhased()
      Description copied from interface: GTRec
      Returns true if every genotype for each sample is a phased, non-missing genotype, and returns false otherwise.
      Specified by:
      isPhased in interface GTRec
      Returns:
      true if the genotype for each sample is a phased, non-missing genotype
    • samples

      public Samples samples()
      Description copied from interface: GTRec
      Returns the list of samples.
      Specified by:
      samples in interface GTRec
      Returns:
      the list of samples
    • size

      public int size()
      Description copied from interface: GTRec
      Returns the number of haplotypes.
      Specified by:
      size in interface GTRec
      Specified by:
      size in interface IntArray
      Returns:
      the number of haplotypes
    • marker

      public Marker marker()
      Description copied from interface: GTRec
      Returns the marker.
      Specified by:
      marker in interface GTRec
      Returns:
      the marker
    • get

      public int get(int hap)
      Description copied from interface: GTRec
      Returns the specified allele for the specified haplotype or -1 if the allele is missing. The two alleles for a sample at a marker are arbitrarily ordered if this.unphased(marker, hap/2) == false.
      Specified by:
      get in interface GTRec
      Specified by:
      get in interface IntArray
      Parameters:
      hap - a haplotype index
      Returns:
      the specified allele for the specified sample
    • majorAllele

      public int majorAllele()
      Returns the major allele. If both alleles have the same allele count, the reference allele is returned.
      Returns:
      the major allele
    • alleleCount

      public int alleleCount(int allele)
      Returns the number of copies of the specified allele.
      Parameters:
      allele - an allele
      Returns:
      the number of copies of the specified allele
      Throws:
      IndexOutOfBoundsException - if allele < 0 || allele >= this.marker().nAlleles()
    • toString

      public String toString()
      Returns the data represented by this as a VCF record with a GT format field. The returned VCF record will have missing QUAL and INFO fields, will have "PASS" in the filter field, and will have a GT format field.
      Overrides:
      toString in class Object
      Returns:
      the data represented by this as a VCF record with a GT format field