public abstract class HaplotypeProbabilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
HaplotypeProbabilities.Genotype
Log10(P(evidence| haplotype)) for the 3 different possible haplotypes
{aa, ab, bb}
|
Modifier | Constructor and Description |
---|---|
protected |
HaplotypeProbabilities(HaplotypeBlock haplotypeBlock) |
Modifier and Type | Method and Description |
---|---|
HaplotypeBlock |
getHaplotype()
Returns the haplotype for which the probabilities apply.
|
abstract double[] |
getLikelihoods()
Returns the likelihoods, in order, of the AA, Aa and aa haplotypes given the evidence
Mathematically this is P(evidence | haplotype) where haplotype={AA,Aa,aa}.
|
double |
getLodMostProbableGenotype()
Returns the LOD score between the most probable haplotype and the second most probable.
|
double[] |
getLogLikelihoods() |
DiploidGenotype |
getMostLikelyGenotype(Snp snp)
Gets the genotype for this Snp given the most likely haplotype.
|
DiploidHaplotype |
getMostLikelyHaplotype()
Gets the most likely haplotype given the probabilities.
|
int |
getObsAllele1()
Returns the number of observations of alleles supporting the first/major haplotype allele.
|
int |
getObsAllele2()
Returns the number of observations of alleles supporting the second/minor haplotype allele.
|
double[] |
getPosteriorProbabilities()
Returns the posterior probabilities using the population frequency as a prior.
|
double[] |
getPriorProbablities() |
abstract Snp |
getRepresentativeSnp()
Returns a representative SNP for this haplotype.
|
int |
getTotalObs()
Returns the total number of observations of any allele.
|
boolean |
hasEvidence()
Returns true if evidence has been added, false if the probabilities are just the priors.
|
abstract void |
merge(HaplotypeProbabilities other)
Merges in the likelihood information from the supplied haplotype probabilities object.
|
double |
scaledEvidenceProbabilityUsingGenotypeFrequencies(double[] genotypeFrequencies)
This function returns the scaled probability of the evidence collected
given a vector of priors on the haplotype using the internal likelihood, which may be
scaled by an unknown factor.
|
double |
shiftedLogEvidenceProbability()
Returns log (p(evidence)) + c assuming that the prior on haplotypes is given by
the internal haplotypeFrequencies
|
double |
shiftedLogEvidenceProbabilityGivenOtherEvidence(HaplotypeProbabilities otherHp)
returns the log-probability the evidence, using as priors the posteriors of another object
|
double |
shiftedLogEvidenceProbabilityUsingGenotypeFrequencies(double[] genotypeFrequencies) |
protected HaplotypeProbabilities(HaplotypeBlock haplotypeBlock)
public HaplotypeBlock getHaplotype()
public double[] getPriorProbablities()
public double[] getPosteriorProbabilities()
public abstract double[] getLikelihoods()
public double[] getLogLikelihoods()
public abstract Snp getRepresentativeSnp()
public int getObsAllele1()
public int getObsAllele2()
public int getTotalObs()
public boolean hasEvidence()
public abstract void merge(HaplotypeProbabilities other)
public DiploidHaplotype getMostLikelyHaplotype()
public DiploidGenotype getMostLikelyGenotype(Snp snp)
public double scaledEvidenceProbabilityUsingGenotypeFrequencies(double[] genotypeFrequencies)
genotypeFrequencies
- vector of (possibly scaled) probabilities of the three haplotypespublic double shiftedLogEvidenceProbabilityUsingGenotypeFrequencies(double[] genotypeFrequencies)
public double shiftedLogEvidenceProbabilityGivenOtherEvidence(HaplotypeProbabilities otherHp)
otherHp
- an additional HaplotypeProbabilities object representing the same underlying HaplotypeBlockpublic double shiftedLogEvidenceProbability()
public double getLodMostProbableGenotype()