Package beagleutil

Class PbwtUpdater

java.lang.Object
beagleutil.PbwtUpdater

public class PbwtUpdater extends Object

Class PbwtDivUpdater updates prefix arrays using the positional Burrows-Wheeler transform (PBWT).

Instances of PbwtDivUpdater 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

    Modifier and Type
    Method
    Description
    int
    Returns the number of haplotypes.
    void
    update(int[] alleles, int nAlleles, int[] prefix)
    Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform.
    void
    update(IntArray rec, int nAlleles, int[] prefix)
    Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform.

    Methods inherited from class java.lang.Object

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

    • PbwtUpdater

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

    • nHaps

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

      public void update(IntArray rec, int nAlleles, int[] prefix)
      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).
      Parameters:
      rec - the haplotype alleles
      nAlleles - the number of alleles
      prefix - the prefix array
      Throws:
      IllegalArgumentException - if nAlleles < 1
      IllegalArgumentException - if rec.size() != this.nHaps() || prefix.length != this.nHaps()
      IndexOutOfBoundsException - if (prefix[j] < 0 || prefix[j] >= rec.size() for any j satisfying (0 <= j && j < prefix.length)
      IndexOutOfBoundsException - if (rec.get[j] < 0 || rec.get(j) >= nAlleles) for any j satisfying (0 <= j && j < this.nHaps())
      NullPointerException - if rec == null || prefix == null
    • update

      public void update(int[] alleles, int nAlleles, int[] prefix)
      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).
      Parameters:
      alleles - the haplotype alleles
      nAlleles - the number of alleles
      prefix - the prefix array
      Throws:
      IllegalArgumentException - if nAlleles < 1
      IllegalArgumentException - if alleles.length != this.nHaps() || prefix.length != this.nHaps()
      IndexOutOfBoundsException - if (prefix[j] < 0 || prefix[j] >= rec.size() for any j satisfying (0 <= j && j < prefix.length)
      IndexOutOfBoundsException - if (alleles[j] < 0 || alleles[j] >= nAlleles) for any j satisfying (0 <= j && j < this.nHaps())
      NullPointerException - if alleles == null || prefix == null