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 == null
public float allele(int marker, int allele)
HapAlleleProbs
allele
in interface HapAlleleProbs
marker
- a marker indexallele
- an allele indexpublic int alleleWithMaxProb(int marker)
HapAlleleProbs
alleleWithMaxProb
in interface HapAlleleProbs
marker
- a marker indexpublic int nMarkers()
HapAlleleProbs
nMarkers
in interface HapAlleleProbs
public Markers markers()
HapAlleleProbs
markers
in interface HapAlleleProbs
public Marker marker(int marker)
HapAlleleProbs
marker
in interface HapAlleleProbs
marker
- a marker indexpublic int hapIndex()
HapAlleleProbs
k
have indices 2*k
and 2*k + 1
.hapIndex
in interface HapAlleleProbs
public Samples samples()
HapAlleleProbs
samples
in interface HapAlleleProbs
public java.lang.String toString()
this
. The exact details
of the representation are unspecified and subject to change.toString
in class java.lang.Object
this