public final class PosteriorProbabilitiesUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PosteriorProbabilitiesUtils.PosteriorProbabilitiesOptions
A class to wrangle all the various and sundry genotype posterior options,
mostly from CalculateGenotypePosteriors
|
Modifier and Type | Method and Description |
---|---|
protected static java.util.List<double[]> |
calculatePosteriorProbs(java.util.List<double[]> genotypeLikelihoods,
double[] knownAlleleCountsByAllele,
int ploidy,
boolean useFlatPriors)
Given genotype likelihoods and known allele counts, calculate the posterior probabilities
over the genotype states
|
static htsjdk.variant.variantcontext.VariantContext |
calculatePosteriorProbs(htsjdk.variant.variantcontext.VariantContext vc1,
java.util.List<htsjdk.variant.variantcontext.VariantContext> resources,
int numRefSamplesFromMissingResources,
PosteriorProbabilitiesUtils.PosteriorProbabilitiesOptions opts)
Calculates phred-scaled posterior probabilities for genotypes given the data and allele frequency priors.
|
static int[] |
extractInts(java.lang.Object integerListContainingVCField)
Check the formatting on the Object returned by a call to VariantContext::getAttribute() and parse appropriately
|
static int[] |
parsePosteriorsIntoPhredSpace(htsjdk.variant.variantcontext.Genotype genotype) |
static double[] |
parsePosteriorsIntoProbSpace(htsjdk.variant.variantcontext.Genotype genotype) |
public static htsjdk.variant.variantcontext.VariantContext calculatePosteriorProbs(htsjdk.variant.variantcontext.VariantContext vc1, java.util.List<htsjdk.variant.variantcontext.VariantContext> resources, int numRefSamplesFromMissingResources, PosteriorProbabilitiesUtils.PosteriorProbabilitiesOptions opts)
vc1
- input variant contextresources
- variants to use to calculate genotype priors (should already be checked for matching start position)numRefSamplesFromMissingResources
- the number of reference samples to use for the prior (already accounted for resource missingness)public static int[] parsePosteriorsIntoPhredSpace(htsjdk.variant.variantcontext.Genotype genotype)
public static double[] parsePosteriorsIntoProbSpace(htsjdk.variant.variantcontext.Genotype genotype)
protected static java.util.List<double[]> calculatePosteriorProbs(java.util.List<double[]> genotypeLikelihoods, double[] knownAlleleCountsByAllele, int ploidy, boolean useFlatPriors)
genotypeLikelihoods
- - the genotype likelihoods for the individualknownAlleleCountsByAllele
- - the known allele counts in the population. For AC=2 AN=12 site, this is {10,2}ploidy
- - the ploidy to assumeuseFlatPriors
- - if true, apply flat priors to likelihoods in order to calculate posterior probabilitiespublic static int[] extractInts(java.lang.Object integerListContainingVCField)
integerListContainingVCField
- - Object returned by a call to VariantContext::getAttribute()