public class BasicAlleleProbs extends java.lang.Object implements AlleleProbs
Class BasicAlleleProbs stores per-haplotype allele probabilities
for a list of samples.
Instances of class BasicAlleleProbs are immutable.
| Constructor and Description |
|---|
BasicAlleleProbs(HapAlleleProbs[] alProbs)
Construct a new
BasicAlleleProbs instance from the specified
data. |
| 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 BasicAlleleProbs(HapAlleleProbs[] alProbs)
BasicAlleleProbs instance from the specified
data.alProbs - allele probabilities for each haplotypejava.lang.IllegalArgumentException - if
alProbs[j].markers().equals(alProbs[k].markers) == false
for any j, k satisfying
(0 <= j && j < k && k < alProbs.length)java.lang.IllegalArgumentException - if
alProbs[j].samples().equals(alProbs[k].samples) == false
for any j, k satisfying
(0 <= j && j < k && k < alProbs.length)java.lang.IllegalArgumentException - if
alProbs.length == 0 || alProbs.length != alProbs[0].nMarkers()java.lang.NullPointerException - if
alProbs == null || alProbs[j] == null for any j satisfying
(0 <= j && j < alProbs.length)public float alProb1(int marker,
int sample,
int allele)
AlleleProbsalProb1 in interface AlleleProbsmarker - a marker indexsample - a sample indexallele - an allele indexpublic float alProb2(int marker,
int sample,
int allele)
AlleleProbsalProb2 in interface AlleleProbsmarker - 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 AlleleProbsmarker - 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)
AlleleProbsallele1 in interface AlleleProbsmarker - a marker indexsample - a sample indexpublic int allele2(int marker,
int sample)
AlleleProbsallele2 in interface AlleleProbsmarker - a marker indexsample - a sample indexpublic int nMarkers()
AlleleProbsnMarkers in interface AlleleProbspublic Markers markers()
AlleleProbsmarkers in interface AlleleProbspublic Marker marker(int marker)
AlleleProbsmarker in interface AlleleProbsmarker - a marker indexpublic int nSamples()
AlleleProbsnSamples in interface AlleleProbspublic Samples samples()
AlleleProbssamples in interface AlleleProbs