Package phase
Class HapImputer
- java.lang.Object
-
- phase.HapImputer
-
public class HapImputer extends java.lang.Object
Class
ImputableHaps
performs imputation to estimate missing alleles and missing haplotype phase.Instances of
ImputableHaps
are thread-safe.
-
-
Constructor Summary
Constructors Constructor Description HapImputer(Markers markers, Samples samples)
Constructs a newImputedHaps
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GT
imputedHaps()
Returns the imputed haplotypes.Markers
markers()
Returns the list of markers.void
setHap(int hap, int[] alleles)
Stores the specified haplotype.void
setPartlyImputedAllele(int hap, int marker, float[] alProbs, IntList refHaps, FloatList stateProbs)
Stores a partially-imputed allele.Samples
targSamples()
Returns the list of target samples.
-
-
-
Method Detail
-
targSamples
public Samples targSamples()
Returns the list of target samples.- Returns:
- the list of target samples
-
markers
public Markers markers()
Returns the list of markers.- Returns:
- the list of markers
-
setHap
public void setHap(int hap, int[] alleles)
Stores the specified haplotype.- Parameters:
hap
- the haplotype indexalleles
- the haplotype- Throws:
java.lang.IndexOutOfBoundsException
- ifhap < 0 || hap >= 2*this.samples()
java.lang.IllegalArgumentException
- ifalleles.length != this.markers().nMarkers()
java.lang.NullPointerException
- ifalleles == null
-
setPartlyImputedAllele
public void setPartlyImputedAllele(int hap, int marker, float[] alProbs, IntList refHaps, FloatList stateProbs)
Stores a partially-imputed allele. ifalProbs.length < this.markers().marker(marker).nAlleles()
, the missing allele probabilities are assumed to be 0.0.- Parameters:
hap
- the haplotype indexmarker
- the marker indexalProbs
- the posterior allele probabilities computed from a subset of HMM statesrefHaps
- the list of reference haplotypes for HMM states not included in the specified allele probabilitiesstateProbs
- the list of state probabilities for each HMM state in the specified list of reference haplotypes- Throws:
java.lang.IndexOutOfBoundsException
- ifhap < 0 || hap >= 2 * this.targSamples().nSamples()
java.lang.IndexOutOfBoundsException
- ifmarker < 0 || marker >= this.markers().nMarkers()
java.lang.IllegalArgumentException
- ifrefHaps.size() != stateProbs.size()
java.lang.NullPointerException
- ifalProbs == null || refHaps == null || stateProbs == null
-
imputedHaps
public GT imputedHaps()
Returns the imputed haplotypes.- Returns:
- the imputed haplotypes
- Throws:
java.lang.NullPointerException
- ifthis.setHap()
has not previously been called for each haplotypeh
satisfying(0 <= h && h <= 2 * this.targSamples().nSamples())
-
-