Package beagleutil

Class PbwtUpdater


  • public class PbwtUpdater
    extends java.lang.Object

    Class PbwtUpdater updates prefix and divergence arrays using the positional Burrows-Wheeler transform (PBWT).

    Instances of PbwtUpdater are not thread-safe.

    Reference: Durbin, Richard (2014) Efficient haplotype matching and storage using the positional Burrows-Wheeler transform (PBWT). Bioinformatics 30(9):166-1272. doi: 10.1093/bioinformatics/btu014

    • Constructor Summary

      Constructors 
      Constructor Description
      PbwtUpdater​(int nHaps)
      Constructs a new PbwtUpdater instance for the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bwdUpdate​(IntArray rec, int nAlleles, int marker, int[] prefix, int[] div)
      Update the specified prefix and divergence arrays using the backward Positional Burrows-Wheeler Transform.
      void fwdUpdate​(IntArray rec, int nAlleles, int marker, int[] prefix, int[] div)
      Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform.
      int nHaps()
      Returns the number of haplotypes.
      • Methods inherited from class java.lang.Object

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

      • PbwtUpdater

        public PbwtUpdater​(int nHaps)
        Constructs a new PbwtUpdater instance for the specified data.
        Parameters:
        nHaps - the number of haplotypes at each position
        Throws:
        java.lang.NegativeArraySizeException - if nHaps < 0
    • Method Detail

      • nHaps

        public int nHaps()
        Returns the number of haplotypes.
        Returns:
        the number of haplotypes
      • fwdUpdate

        public void fwdUpdate​(IntArray rec,
                              int nAlleles,
                              int marker,
                              int[] prefix,
                              int[] div)
        Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform. The contract for this method is undefined if the specified prefix array is not a permutation of 0, 1, 2, ..., (nHaps - 1), or if the elements of the specified div arrays are not all less than or equal to the specified marker.
        Parameters:
        rec - the haplotype alleles
        nAlleles - the number of alleles
        marker - the marker index for the specified haplotype alleles
        prefix - the prefix array
        div - the divergence array
        Throws:
        java.lang.IllegalArgumentException - if nAlleles < 1
        java.lang.IndexOutOfBoundsException - if (rec.get[j] < 0 || rec.get(j) >= nAlleles) for any j satisfying (0 <= j && j < this.nHaps())
        java.lang.IndexOutOfBoundsException - if prefix.length >= this.nHaps()
        java.lang.IndexOutOfBoundsException - if div.length >= this.nHaps()
        java.lang.NullPointerException - if rec == null || prefix == null || div == null
      • bwdUpdate

        public void bwdUpdate​(IntArray rec,
                              int nAlleles,
                              int marker,
                              int[] prefix,
                              int[] div)
        Update the specified prefix and divergence arrays using the backward Positional Burrows-Wheeler Transform. The contract for this method is undefined if the specified prefix array is not a permutation of 0, 1, 2, ..., (nHaps - 1), or if the elements of the specified div arrays are not all greater than or equal to the specified marker.
        Parameters:
        rec - the haplotype alleles
        nAlleles - the number of alleles
        marker - the marker index for the specified haplotype alleles
        prefix - the prefix array
        div - the divergence array
        Throws:
        java.lang.IllegalArgumentException - if nAlleles < 1
        java.lang.IndexOutOfBoundsException - if (rec.get[j] < 0 || rec.get(j) >= nAlleles) for any j satisfying (0 <= j && j < this.nHaps())
        java.lang.IndexOutOfBoundsException - if prefix.length >= this.nHaps()
        java.lang.IndexOutOfBoundsException - if div.length >= this.nHaps()
        java.lang.NullPointerException - if rec == null || prefix == null || div == null