Struct libprosic::model::priors::tumor_normal::TumorNormalModel
[−]
[src]
pub struct TumorNormalModel { pub normal_model: InfiniteSitesNeutralVariationModel, pub allele_freqs_tumor: ContinuousAlleleFreqs, pub grid_points: usize, // some fields omitted }
Tumor-normal prior model using ploidy, heterozygosity (in normal tissue) and tumor mutation rate
per effective cell division.
The latter is the quotient mu/beta, with mu being the mutation rate and beta being the fraction
of effective cell divisions (both lineages survive). Alone, the parameters are not observable.
However, mu/beta can be estimated from e.g. SNV calls. It is the slope of the linear model
y = mu/beta * (x - 1 / fmax)
, with
x` being the reciprocal of the observed allele frequencies
and y being the number of observed mutations corresponding to each frequency
(see Williams et al. Nature Genetics 2016).
Based on the Williams model, the tail probability of a somatic allele frequency F > f can be expressed
as
Pr(F > f) = M(f) / n = mu/beta (1 / f - 1 / fmax) / n
with n
being the size of the genome and fmax
is the expected allele frequency of clonal variants
at the beginning of tumor evolution.
From this, we can obtain the cumulative distribution function as Pr(F <= f) = 1 - Pr(F > f)
.
Consequently, the density becomes the first derivative, i.e. Pr(F = f) = - M(f)' / n = mu/beta * 1/n * 1/f²
for f>=fmin
with fmin = sqrt(mu/beta * 1/n)
.
The prior probability for a germline allele frequency f (e.g. 0.0, 0.5, 1.0) in the tumor is
calculated with an InfiniteSitesNeutralVariationModel
. This is valid since clonal variants
come from the underlying normal tissue and Williams model assumes that allele frequencies
do not change during tumor evolution (no genetic drift, no selection).
For the final prior, we consider a given tumor purity and calculate the combined prior
for all possible allele frequency combinations satisfying af = purity * af_tumor + (1-purity) * af_normal
.
Fields
normal_model: InfiniteSitesNeutralVariationModel
allele_freqs_tumor: ContinuousAlleleFreqs
grid_points: usize
Methods
impl TumorNormalModel
[src]
fn new(ploidy: u32, effective_mutation_rate: f64, deletion_factor: f64, insertion_factor: f64, genome_size: u64, heterozygosity: Prob) -> Self
Create new model.
Arguments
ploidy
- the ploidy in the corresponding normal sample (e.g. 2 for diploid)effective_mutation_rate
- the SNV mutation rate per effective cell division in the tumordeletion_factor
- ratio of deletions compared to SNV mutation rateinsertion_factor
- ratio of insertions compared to SNV mutation rategenome_size
- the size of the genomeheterozygosity
- expected heterozygosity in the corresponding normal
fn somatic_prior_prob(&self, af_somatic: AlleleFreq, variant: Variant) -> LogProb
fn normal_prior_prob(&self, af_normal: AlleleFreq, variant: Variant) -> LogProb
Trait Implementations
impl PairModel<ContinuousAlleleFreqs, DiscreteAlleleFreqs> for TumorNormalModel
[src]
fn prior_prob(&self, af_tumor: AlleleFreq, af_normal: AlleleFreq, variant: Variant) -> LogProb
Calculate prior probability of given combination of allele frequencies.
fn joint_prob<L, O>(&self, af_tumor: &ContinuousAlleleFreqs, af_normal: &DiscreteAlleleFreqs, likelihood_tumor: &L, likelihood_normal: &O, variant: Variant) -> LogProb where L: Fn(AlleleFreq, AlleleFreq) -> LogProb, O: Fn(AlleleFreq, AlleleFreq) -> LogProb
Calculate joint probability of prior with likelihoods for given allele frequency ranges.
fn marginal_prob<L, O>(&self, likelihood_tumor: &L, likelihood_normal: &O, variant: Variant) -> LogProb where L: Fn(AlleleFreq, AlleleFreq) -> LogProb, O: Fn(AlleleFreq, AlleleFreq) -> LogProb
Calculate marginal probability.
fn map<L, O>(&self, likelihood_tumor: &L, likelihood_normal: &O, variant: Variant) -> (AlleleFreq, AlleleFreq) where L: Fn(AlleleFreq, AlleleFreq) -> LogProb, O: Fn(AlleleFreq, AlleleFreq) -> LogProb
Calculate maximum a posteriori probability estimate of allele frequencies.
fn allele_freqs(&self) -> (&ContinuousAlleleFreqs, &DiscreteAlleleFreqs)
Return allele frequency spectra.