Package picard.fingerprint

# Class HaplotypeProbabilitiesFromContaminatorSequence

java.lang.Object
picard.fingerprint.HaplotypeProbabilities
picard.fingerprint.HaplotypeProbabilitiesFromSequence
picard.fingerprint.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.

## Nested Class Summary

## Nested classes/interfaces inherited from class picard.fingerprint.HaplotypeProbabilities

`HaplotypeProbabilities.Genotype`

## Field Summary

Fields
Modifier and Type
Field
Description
`double`
`contamination`

### Fields inherited from class picard.fingerprint.HaplotypeProbabilitiesFromSequence

`obsAllele1, obsAllele2, obsAlleleOther`

## Constructor Summary

Constructors
Constructor
Description
`HaplotypeProbabilitiesFromContaminatorSequence(HaplotypeBlock haplotypeBlock, double contamination)`
`HaplotypeProbabilitiesFromContaminatorSequence(HaplotypeProbabilitiesFromContaminatorSequence other)`

## Method Summary

Modifier and Type
Method
Description
`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.
`HaplotypeProbabilitiesFromContaminatorSequence`
`deepCopy()`
`double[]`
`getLikelihoods()`
Converts the loglikelihoods into linear-space with normalizing.
`double[]`
`getLikelihoods0()`
`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 log-rawLikelihoods natively, we override and return the native variable
`double[]`
`getPosteriorProbabilities()`
getter for posteriorProbs
`protected double[]`
`getPosteriorProbabilities0()`
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.
`HaplotypeProbabilitiesFromContaminatorSequence`
`merge(HaplotypeProbabilities other)`
Merges information from another haplotype probabilities object for the same haplotype into this object.
`void`
`setLogLikelihoods(double[] ll)`

### Methods inherited from class picard.fingerprint.HaplotypeProbabilitiesFromSequence

`getFractionUnexpectedAlleleObs, getObsAllele1, getObsAllele2, getTotalObs, hasEvidence`

### Methods inherited from class picard.fingerprint.HaplotypeProbabilities

`getHaplotype, getMostLikelyGenotype, getMostLikelyHaplotype, getPosteriorLikelihoods, getPriorProbablities, scaledEvidenceProbabilityUsingGenotypeFrequencies, shiftedLogEvidenceProbability, shiftedLogEvidenceProbabilityGivenOtherEvidence, shiftedLogEvidenceProbabilityUsingGenotypeFrequencies`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### contamination

public double contamination

## Constructor Details

### HaplotypeProbabilitiesFromContaminatorSequence

public HaplotypeProbabilitiesFromContaminatorSequence(HaplotypeBlock haplotypeBlock, double contamination)

### HaplotypeProbabilitiesFromContaminatorSequence

public HaplotypeProbabilitiesFromContaminatorSequence(HaplotypeProbabilitiesFromContaminatorSequence other)

## Method Details

### 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

### deepCopy

public HaplotypeProbabilitiesFromContaminatorSequence deepCopy()

Overrides:
  `deepCopy` in class `HaplotypeProbabilitiesFromSequence`

### merge

public HaplotypeProbabilitiesFromContaminatorSequence merge(HaplotypeProbabilities other)
Description copied from class: `HaplotypeProbabilitiesFromSequence`
Merges information from another haplotype probabilities object for the same haplotype into this object. Useful for when probabilities need to be merged to levels higher than the read group, e.g. the sample or individual.

Overrides:
  `merge` in class `HaplotypeProbabilitiesFromSequence`
Parameters:
  `other` - Another haplotype probabilities object to merge in
Returns:

### 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

### getRepresentativeSnp

public Snp getRepresentativeSnp()
Simple returns the SNP from the haplotype that has the lowest genome coordinate.

Specified by:
  `getRepresentativeSnp` in class `HaplotypeProbabilities`

### getPosteriorProbabilities0

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

### getPosteriorProbabilities

public double[] getPosteriorProbabilities()
getter for posteriorProbs

Overrides:
  `getPosteriorProbabilities` in class `HaplotypeProbabilities`

### 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`