public class LowMemHapAlleleProbs extends java.lang.Object implements HapAlleleProbs
Class LowMemHapAlleleProbs stores allele probabilities for
a haplotype.
LowMemHapAlleleProbs are immutable.| Constructor and Description |
|---|
LowMemHapAlleleProbs(Markers markers,
Samples samples,
int hap,
float[] alleleProbs)
Constructs a new
LowMemHapAlleleProbs instance. |
| Modifier and Type | Method and Description |
|---|---|
float |
allele(int marker,
int allele)
Returns the specified allele probability.
|
int |
alleleWithMaxProb(int marker)
Returns the allele with maximum posterior probability.
|
int |
hapIndex()
Returns the haplotype index.
|
Marker |
marker(int marker)
Returns the specified marker.
|
Markers |
markers()
Returns the list of markers.
|
int |
nMarkers()
Returns the number of markers.
|
Samples |
samples()
Returns the list of samples.
|
java.lang.String |
toString()
Returns a string representation of
this. |
public LowMemHapAlleleProbs(Markers markers, Samples samples, int hap, float[] alleleProbs)
LowMemHapAlleleProbs instance. The
alleleProbs array lists the probability of each allele for
each marker, sorted first by marker index, and then by allele index.markers - the markerssamples - the sampleshap - the haplotype indexalleleProbs - the allele probabilitiesjava.lang.IllegalArgumentException - if
alleleProbs.length != markers.sumAlleles()java.lang.IndexOutOfBoundsException - if
hap < 0 || hap >= 2*samples.nSamples()java.lang.NullPointerException - if
markers == null || samples == nullpublic float allele(int marker,
int allele)
HapAlleleProbsallele in interface HapAlleleProbsmarker - a marker indexallele - an allele indexpublic int alleleWithMaxProb(int marker)
HapAlleleProbsalleleWithMaxProb in interface HapAlleleProbsmarker - a marker indexpublic int nMarkers()
HapAlleleProbsnMarkers in interface HapAlleleProbspublic Markers markers()
HapAlleleProbsmarkers in interface HapAlleleProbspublic Marker marker(int marker)
HapAlleleProbsmarker in interface HapAlleleProbsmarker - a marker indexpublic int hapIndex()
HapAlleleProbsk
have indices 2*k and 2*k + 1.hapIndex in interface HapAlleleProbspublic Samples samples()
HapAlleleProbssamples in interface HapAlleleProbspublic java.lang.String toString()
this. The exact details
of the representation are unspecified and subject to change.toString in class java.lang.Objectthis