public class SampleHapPairAlleleProbs extends java.lang.Object implements AlleleProbs
Class SampleHapPairAlleleProbs
is a wrapper for a
SampleHapPairs
instance.
Instances of class HaplotypeAlleleProbs
are immutable.
Constructor and Description |
---|
SampleHapPairAlleleProbs(SampleHapPairs sampleHapPairs)
Constructs a new
SampleHapPairAlleleProbs instance that wraps
the specified SampleHapPairs object. |
Modifier and Type | Method and Description |
---|---|
int |
allele1(int marker,
int sample)
Returns the marker allele with maximum probability for the
first haplotype of the specified sample.
|
int |
allele2(int marker,
int sample)
Returns the marker allele with maximum probability for the
second haplotype of the specified sample.
|
float |
alProb1(int marker,
int sample,
int allele)
Returns the probability that the specified marker allele is
present on the first haplotype of the specified sample.
|
float |
alProb2(int marker,
int sample,
int allele)
Returns the probability that the specified marker allele is
present on the second haplotype of the specified sample.
|
float |
gtProb(int marker,
int sample,
int allele1,
int allele2)
Returns the phased genotype probability, equal to
(this.allele1(marker, sample, allele1)
* this.allele2(marker, sample, allele2)) . |
Marker |
marker(int marker)
Returns the specified marker.
|
Markers |
markers()
Returns the list of markers.
|
int |
nMarkers()
Returns the number of markers.
|
int |
nSamples()
Returns the number of samples.
|
Samples |
samples()
Returns the list of samples.
|
public SampleHapPairAlleleProbs(SampleHapPairs sampleHapPairs)
SampleHapPairAlleleProbs
instance that wraps
the specified SampleHapPairs
object. The alleles in
the specified SampleHapPairs
instance will have
probability 1.sampleHapPairs
- the sample haplotype pairs that will
be wrapped by this
java.lang.NullPointerException
- if sampleHapPairs == null
public float alProb1(int marker, int sample, int allele)
AlleleProbs
alProb1
in interface AlleleProbs
marker
- a marker indexsample
- a sample indexallele
- an allele indexpublic float alProb2(int marker, int sample, int allele)
AlleleProbs
alProb2
in interface AlleleProbs
marker
- a marker indexsample
- a sample indexallele
- an allele indexpublic float gtProb(int marker, int sample, int allele1, int allele2)
AlleleProbs
(this.allele1(marker, sample, allele1)
* this.allele2(marker, sample, allele2))
.gtProb
in interface AlleleProbs
marker
- a marker indexsample
- a sample indexallele1
- allele index of the allele on the first haplotypeallele2
- allele index of the allele on the second haplotype(this.allele1(marker, sample, allele1)
* this.allele2(marker, sample, allele2))
public int allele1(int marker, int sample)
AlleleProbs
allele1
in interface AlleleProbs
marker
- a marker indexsample
- a sample indexpublic int allele2(int marker, int sample)
AlleleProbs
allele2
in interface AlleleProbs
marker
- a marker indexsample
- a sample indexpublic Marker marker(int marker)
AlleleProbs
marker
in interface AlleleProbs
marker
- a marker indexpublic Markers markers()
AlleleProbs
markers
in interface AlleleProbs
public int nMarkers()
AlleleProbs
nMarkers
in interface AlleleProbs
public int nSamples()
AlleleProbs
nSamples
in interface AlleleProbs
public Samples samples()
AlleleProbs
samples
in interface AlleleProbs