Package phase

Class RevPbwtPhaser


  • public class RevPbwtPhaser
    extends java.lang.Object

    Class RevPbwtPhaser phases input genotype data and imputes missing alleles using the Positional Burrows-Wheeler Transform (PBWT). The PBWT processes markers in order of decreasing marker index. Any heterozygote genotypes that cannot by phased using the PBWT are randomly phased, and any alleles that cannot be imputed using the PBWT are randomly imputed using the allele frequencies in the combined reference and target input genotype data.

    Instances of class RevPbwtPhaser are immutable.

    Reference: Richard Durbin. (2014) Efficient haplotype matching and storage using the Positional Burrows-Wheeler Transform (PBWT). Bioinformatics 30(9):1266-72.

    Reference: Olivier Delaneau, Jean-Francois Zagury, Matthew R Robinson, Jonathan Marchini, Emmanouil Dermitzakis. (2019) Accurate, scalable and integrative haplotype estimation. Nature Communications 10(1):5436.

    • Constructor Summary

      Constructors 
      Constructor Description
      RevPbwtPhaser​(FixedPhaseData fpd, int start, int end, long seed)
      Creates a new RevPbwtPhaser for the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int allele​(int marker, int hap)
      Returns the specified allele
      int bitsPerAllele​(int marker)
      Returns the minimum number of bits required to store a non-missing allele for the specified marker
      int end()
      Return the exclusive end marker index.
      int start()
      Return the inclusive start marker index.
      GT targGT()
      Returns the input target genotypes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RevPbwtPhaser

        public RevPbwtPhaser​(FixedPhaseData fpd,
                             int start,
                             int end,
                             long seed)
        Creates a new RevPbwtPhaser for the specified data.
        Parameters:
        fpd - the input genotype data for phasing
        start - the index of the first marker (inclusive) to be phased
        end - the index of the last marker (exclusive) to be phased
        seed - seed for random number generation
        Throws:
        java.lang.IllegalArgumentException - if start < 0 || end > fpd.stage1TargGt().nMarkers() || start >= end
        java.lang.NullPointerException - if fpd == null
    • Method Detail

      • targGT

        public GT targGT()
        Returns the input target genotypes.
        Returns:
        the input target genotypes
      • start

        public int start()
        Return the inclusive start marker index.
        Returns:
        the inclusive start marker index
      • end

        public int end()
        Return the exclusive end marker index.
        Returns:
        the exclusive end marker index
      • bitsPerAllele

        public int bitsPerAllele​(int marker)
        Returns the minimum number of bits required to store a non-missing allele for the specified marker
        Parameters:
        marker - a marker index
        Returns:
        the minimum number of bits required to store a non-missing allele for the specified marker
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < this.start() || marker >= this.end()
      • allele

        public int allele​(int marker,
                          int hap)
        Returns the specified allele
        Parameters:
        marker - a marker index
        hap - a haplotype index
        Returns:
        the specified allele
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < this.start() || marker >= this.end()
        java.lang.IndexOutOfBoundsException - if hap < 0 || hap >= this.targGT().nHaps()