Class HaplotypeProbabilitiesFromContaminatorSequence


  • public class HaplotypeProbabilitiesFromContaminatorSequence
    extends HaplotypeProbabilitiesFromSequence
    Represents the probability of the underlying haplotype of the contaminating sample given the data. By convention the alleles stored for each SNP are in phase.
    • Field Detail

      • contamination

        public double contamination
    • Constructor Detail

      • HaplotypeProbabilitiesFromContaminatorSequence

        public HaplotypeProbabilitiesFromContaminatorSequence​(HaplotypeBlock haplotypeBlock,
                                                              double contamination)
    • Method Detail

      • addToProbs

        public void addToProbs​(Snp snp,
                               byte base,
                               byte qual)
        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.
        Overrides:
        addToProbs in class HaplotypeProbabilitiesFromSequence
        Parameters:
        snp - The snp in the HaplotypeBlock to which evidence is being added
        base - the base observed
        qual - the quality of the observed base
      • getLikelihoods

        public double[] getLikelihoods()
        Converts the loglikelihoods into linear-space with normalizing.
      • getLogLikelihoods

        public double[] getLogLikelihoods()
        Since this class uses log-rawLikelihoods natively, we override and return the native variable
      • getPosteriorProbabilities0

        protected double[] getPosteriorProbabilities0()
        Returns the posterior probability of the haplotypes given the evidence (uses the internal prior)
      • getLikelihoods0

        public double[] getLikelihoods0()
      • setLogLikelihoods

        public void setLogLikelihoods​(double[] ll)
      • getLodMostProbableGenotype

        public double getLodMostProbableGenotype()
        Overridden to calculate the LOD from the loglikelihoods instead of the probabilities because it will allow for more accurate calculation before overflowing.
        Overrides:
        getLodMostProbableGenotype in class HaplotypeProbabilities