Package beagleutil
Class PbwtDivUpdater
- java.lang.Object
-
- beagleutil.PbwtDivUpdater
-
public class PbwtDivUpdater extends java.lang.ObjectClass
PbwtDivUpdaterupdates prefix and divergence arrays using the positional Burrows-Wheeler transform (PBWT).Instances of
PbwtDivUpdaterare 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 PbwtDivUpdater(int nHaps)Constructs a newPbwtUpdaterinstance for the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbwdUpdate(IntArray rec, int nAlleles, int marker, int[] prefix, int[] div)Update the specified prefix and divergence arrays using the backward Positional Burrows-Wheeler Transform.voidfwdUpdate(IntArray rec, int nAlleles, int marker, int[] prefix, int[] div)Update the specified prefix and divergence arrays using the forward Positional Burrows-Wheeler Transform.intnHaps()Returns the number of haplotypes.
-
-
-
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 specifiedprefixarray is not a permutation of0, 1, 2, ..., (nHaps - 1), or if the elements of the specifieddivarrays 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:
java.lang.IllegalArgumentException- ifnAlleles < 1java.lang.IllegalArgumentException- ifrec.size() != this.nHaps() || prefix.length != this.nHaps()java.lang.IndexOutOfBoundsException- if(prefix[j] < 0 || prefix[j] >= rec.size()for anyjsatisfying(0 <= j && j < prefix.length)java.lang.IndexOutOfBoundsException- if(rec.get[j] < 0 || rec.get(j) >= nAlleles)for anyjsatisfying(0 <= j && j < this.nHaps())java.lang.IndexOutOfBoundsException- ifdiv.length < this.nHaps()java.lang.NullPointerException- ifrec == 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 specifiedprefixarray is not a permutation of0, 1, 2, ..., (nHaps - 1), or if the elements of the specifieddivarrays 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:
java.lang.IllegalArgumentException- ifnAlleles < 1java.lang.IllegalArgumentException- ifrec.size() != this.nHaps() || prefix.length != this.nHaps()java.lang.IndexOutOfBoundsException- if(prefix[j] < 0 || prefix[j] >= rec.size()for anyjsatisfying(0 <= j && j < prefix.length)java.lang.IndexOutOfBoundsException- if(rec.get[j] < 0 || rec.get(j) >= nAlleles)for anyjsatisfying(0 <= j && j < this.nHaps())java.lang.IndexOutOfBoundsException- ifdiv.length < this.nHaps()java.lang.NullPointerException- ifrec == null || prefix == null || div == null
-
-