cellfrequency_pdf(af, cnv, pnb, freq, max_PM=6, snv_cnv_flag=3, SP_cnv = NA, PM_cnv = NA)$PM^B$ and $PN^B$ denote the ploidy of the B allele in each cell type: mutated cells and normal cells, respectively. The value of $PN^B$ is one if $l$ has a germline variant, zero otherwise. $PM, PN$ are the total ploidy of mutated cells and normal cells. $PM$ is required to be between one and $max\_PM$, that is, we exclude solutions for which the maximum number of amplicons per cell exceeds the user defined constant $max\_PM$. The function returns the probability distribution, $P(f)$, that the mutation at locus $l$ is present in a fraction $f$ of cells, where $f \in [0,1]$. Four alternative cell frequency probability distributions, $P(f)$, can be obtained for each allele-frequency + copy number pair (AF, CN).
1. $P_s(f_{cnv})$ separately modeling the size $f_{cnv}$ of the subpopulation propagating an CNV: $PM * f_{cnv} + PN *(1-f_{cnv}) = CN$ 2. $P_s(f_{snv})$ and $P_p(f_{snv})$ modeling the size $f_{snv}$ of the subpopulation propagating an SNV: 2a) $P_s(f_{snv})$: $PM^B * f_{snv} + PN^B *(1-f_{snv}) = AF*CN$, where $PM^B \leq max(2, PM)$; Here $f_{snv}$ is calcualted separately of $f_{cnv}$, under the assumption that i) SNV and CNV occur independently from each other (i.e. they are never co-propagated during the same clonal expansion) or ii) SNV occured in a denscendant of the subpopulation with the CNV. 2b) $P_p(f_{snv})$: $PM^B * (f_{snv}-f_{cnv}) + pm^B * f_{cnv} + PN^B *(1-f_{snv}) = AF*CN$, where $pm^B \neq PM^B$ and $pm^B \neq 2$. Here $f_{snv}$ is calcualted partially dependent on $f_{cnv}$, under the assumption that the SNV occured in an ancestor of the subpopulation with the CNV. 3. $P_j(f)$ jointly modeling the size $f$ of the subpopulation propagating both the SNV and the CNV simulataneously: enforcing both equations, 1) and 2a), with additional constraints: $f:=f_{snv}=f_{cnv}$ and $PM^B \leq PM$
In 1) and 2) the SNV is present in a subpopulation different of the CNV harboring subpopulation. In 3) both the SNV and an CNV at $l$ were propagated during the same clonal expansion.
freq=seq(0.1,1.0,by=0.01);
cfd=cellfrequency_pdf(af=0.26,cnv=1.95,pnb=0,freq=freq, max_PM=6)
plot(freq,cfd$p,type="l",xlab="f",ylab="P(f)");
Run the code above in your browser using DataLab