Package beagleutil
Class PbwtDivUpdater
java.lang.Object
beagleutil.PbwtDivUpdater
Class PbwtDivUpdater
updates prefix and divergence 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
ConstructorsConstructorDescriptionPbwtDivUpdater
(int nHaps) Constructs a newPbwtUpdater
instance for the specified data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Update the specified prefix and divergence arrays using the backward Positional Burrows-Wheeler Transform.void
Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform.int
nHaps()
Returns the number of haplotypes.
-
Constructor Details
-
PbwtDivUpdater
public PbwtDivUpdater(int nHaps) Constructs a newPbwtUpdater
instance for the specified data.- Parameters:
nHaps
- the number of haplotypes at each position- Throws:
NegativeArraySizeException
- ifnHaps < 0
-
-
Method Details
-
nHaps
public int nHaps()Returns the number of haplotypes.- Returns:
- the number of haplotypes
-
fwdUpdate
Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform. The contract for this method is undefined if the specifiedprefix
array is not a permutation of0, 1, 2, ..., (nHaps - 1)
, or if the elements of the specifieddiv
arrays are not all less than or equal to the specifiedmarker
.- Parameters:
rec
- the haplotype allelesnAlleles
- the number of allelesmarker
- the marker index for the specified haplotype allelesprefix
- the prefix arraydiv
- the divergence array- Throws:
IllegalArgumentException
- ifnAlleles < 1
IllegalArgumentException
- ifrec.size() != this.nHaps() || prefix.length != this.nHaps()
IndexOutOfBoundsException
- if(prefix[j] < 0 || prefix[j] >= rec.size()
for anyj
satisfying(0 <= j && j < prefix.length)
IndexOutOfBoundsException
- if(rec.get[j] < 0 || rec.get(j) >= nAlleles)
for anyj
satisfying(0 <= j && j < this.nHaps())
IndexOutOfBoundsException
- ifdiv.length < this.nHaps()
NullPointerException
- ifrec == null || prefix == null || div == null
-
bwdUpdate
Update the specified prefix and divergence arrays using the backward Positional Burrows-Wheeler Transform. The contract for this method is undefined if the specifiedprefix
array is not a permutation of0, 1, 2, ..., (nHaps - 1)
, or if the elements of the specifieddiv
arrays are not all greater than or equal to the specifiedmarker
.- Parameters:
rec
- the haplotype allelesnAlleles
- the number of allelesmarker
- the marker index for the specified haplotype allelesprefix
- the prefix arraydiv
- the divergence array- Throws:
IllegalArgumentException
- ifnAlleles < 1
IllegalArgumentException
- ifrec.size() != this.nHaps() || prefix.length != this.nHaps()
IndexOutOfBoundsException
- if(prefix[j] < 0 || prefix[j] >= rec.size()
for anyj
satisfying(0 <= j && j < prefix.length)
IndexOutOfBoundsException
- if(rec.get[j] < 0 || rec.get(j) >= nAlleles)
for anyj
satisfying(0 <= j && j < this.nHaps())
IndexOutOfBoundsException
- ifdiv.length < this.nHaps()
NullPointerException
- ifrec == null || prefix == null || div == null
-