Description Usage Arguments Details Value See Also Examples
Density, distribution function, quantile function and random generation for mutant cell counts.
1 2 3 4 5 6 | dflan(m,mutations=1,fitness=1,death=0,model=c("LD","H"))
pflan(m,mutations=1,fitness=1,death=0,model=c("LD","H"),lower.tail=TRUE)
qflan(p,mutations=1,fitness=1,death=0,model=c("LD","H"),lower.tail=TRUE)
rflan(n,mutations=1,mutprob=NULL,fitness=1,death=0,
dist=list(name="lnorm",meanlog=-0.3795851,sdlog=0.3016223),
mfn=1e9,cvfn=0)
|
m |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. If |
mutations |
mean number of mutations: positive integer. Ignored if |
mutprob |
mutation probability: numeric between 0 and 1. By default empty. See details. |
fitness |
fitness parameter: numeric positive. |
death |
death probability: numeric between 0 and 0.5. |
dist |
lifetime distribution for mutant cells. See Details. |
model |
statistical lifetime model. Must be one of "LD" (default) for Luria-Delbrück model (exponential lifetimes), or "H" for Haldane model (constant lifetimes). |
mfn |
mean final number of cells: numeric positive. |
cvfn |
coefficient of variation of final numbers of cells: numeric, default 0. If non-zero and if |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x] otherwise, P[X > m] |
The argument dist
is a list beginning with the distribution name followed by its parameters, and must be one the 4 following distributions: "dirac"(location), "exp"(rate), "lnorm"(meanlog, sdlog), "gamma"(shape, scale).
If cvfn
is positive, the final numbers of cells are generated with the log-normal distribution with mean mfn
and coefficient of variation cvfn
.
If mutprob
is non-empty if cvfn
is zero, the sample is computed with mutations
as the product of mutprob
by mfn
. If cvfn
is non-zero, the sample is computed with mutations
as
α = \mathcal{L}≤ft[π≤ft(1-\frac{δ}{1-δ}\right)\right]
whith π is the ratio of mutations
by mfn
, δ the death probability and \mathcal{L}(x) is the Laplace transform of the log-normal distribution with mean mfn
and coefficient of variation cvfn
.
dflan
gives the density, pflan
gives the distribution
function, qflan
gives the quantile function, and rflan
generates a random sample.
rflan
returns a list with two arguments, each with length n
: a vector of integers
$mc
(mutant counts), and a vector of numeric $fn
(final numbers of cells).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #----------------------- distributions ----------------------------------
# Luria-Delbrück model, mean number of mutations 1, fitness parameter 1
dflan(0:10)
pflan(0:10)
qflan(c(0.95,0.99))
# Luria-Delbrück model, mean number of mutations 2, fitness parameter 0.5
qflan(c(0.95,0.99),mutations=2,fitness=0.5)
qflan(c(0.05,0.01),mutations=2,fitness=0.5,lower.tail=FALSE)
# Haldane model, mean number of mutations 2, fitness parameter 0.5
qflan(c(0.95,0.99),mutations=2,fitness=0.5,model="H")
#---------------------- random samples ----------------------------------
# lognormal lifetime distribution, lognormal final numbers
X <- rflan(100,cvfn=0.3)
X$mc # mutant counts
X$fn # final numbers
# mean number of mutations 2, fitness parameter 0.5 (realistic model, but slow)
rflan(1000,mutations=2,fitness=0.5)$mc
# exponential lifetimes (Luria-Delbrück model, fast)
rflan(1000,mutations=2,fitness=0.5,dist=list(name="exp",rate=1))$mc
# constant lifetimes (Haldane model, fast)
rflan(1000,mutations=2,fitness=0.5,dist=list(name="dirac",location=1))$mc
# specifying mutation probability and mean final number
rflan(1000,mutprob=2e-9,mfn=2e9,fitness=0.5,dist=list(name="dirac",location=1))$mc
# positive cell death probability
rflan(1000,mutprob=2e-9,mfn=2e9,death=0.1,fitness=0.5,dist=list(name="dirac",location=1))$mc
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.