public class HaplotypeProbabilitiesFromGenotypeLikelihoods extends HaplotypeProbabilities
HaplotypeProbabilities.Genotype
Constructor and Description |
---|
HaplotypeProbabilitiesFromGenotypeLikelihoods(HaplotypeBlock haplotypeBlock) |
Modifier and Type | Method and Description |
---|---|
void |
addToLogLikelihoods(Snp snp,
java.util.List<htsjdk.variant.variantcontext.Allele> alleles,
double[] logGenotypeLikelihoods)
Adds a base observation with the observed quality to the evidence for this haplotype
based on the fact that the SNP is part of the haplotype.
|
double[] |
getLikelihoods()
Converts the loglikelihoods into linear-space.
|
double |
getLodMostProbableGenotype()
Overridden to calculate the LOD from the loglikelihoods instead of the probabilities
because it will allow for more accurate calculation before overflowing.
|
double[] |
getLogLikelihoods()
Since this class uses loglikelihoods natively, we override and return the native variable
|
double[] |
getPosteriorProbabilities()
Returns the posterior probability of the haplotypes given the evidence (uses the internal prior)
|
Snp |
getRepresentativeSnp()
Simple returns the SNP from the haplotype that has the lowest genome coordinate.
|
boolean |
hasEvidence()
Returns true if evidence has been added, false if the probabilities are just the priors.
|
void |
merge(HaplotypeProbabilities other)
Merges information from another haplotype probabilities object for the same haplotype into
this object.
|
void |
setLogLikelihoods(double[] ll) |
getHaplotype, getMostLikelyGenotype, getMostLikelyHaplotype, getObsAllele1, getObsAllele2, getPriorProbablities, getTotalObs, scaledEvidenceProbabilityUsingGenotypeFrequencies, shiftedLogEvidenceProbability, shiftedLogEvidenceProbabilityGivenOtherEvidence, shiftedLogEvidenceProbabilityUsingGenotypeFrequencies
public HaplotypeProbabilitiesFromGenotypeLikelihoods(HaplotypeBlock haplotypeBlock)
public void addToLogLikelihoods(Snp snp, java.util.List<htsjdk.variant.variantcontext.Allele> alleles, double[] logGenotypeLikelihoods)
snp
- The snp in the haplotypeblock to which the likelihoods belongalleles
- the (ordered) alleles to which the biallelic genotype likelihoods correspond. So that if the alleles are [A,B], thelogGenotypeLikelihoods
- correspond to the logLikelihoods of [AA, AB, BB]. Log is assumed to be in base 10.public Snp getRepresentativeSnp()
getRepresentativeSnp
in class HaplotypeProbabilities
public boolean hasEvidence()
HaplotypeProbabilities
hasEvidence
in class HaplotypeProbabilities
public void merge(HaplotypeProbabilities other)
merge
in class HaplotypeProbabilities
other
- Another haplotype probabilities object to merge in (must of the the same class and for the same HaplotypeBlock)public double[] getPosteriorProbabilities()
getPosteriorProbabilities
in class HaplotypeProbabilities
public double[] getLikelihoods()
getLikelihoods
in class HaplotypeProbabilities
public double[] getLogLikelihoods()
getLogLikelihoods
in class HaplotypeProbabilities
public void setLogLikelihoods(double[] ll)
public double getLodMostProbableGenotype()
getLodMostProbableGenotype
in class HaplotypeProbabilities