Description Usage Arguments Value Examples
View source: R/generate_model.R
Closure function which returns a function generating nb_mut
fitnesses
of mutant(s) (based on a wild-type of fitness given in the last element of the
first row of empirical_fl
). The model used for generating the mutant can
chosen with model_type
.
The function returned then take a list of varying length as argument depending
on model_type
.
1 | generate_model(empirical_fl, model_type, fun_args = list(), ...)
|
empirical_fl |
A matrix corresponding to an empirical fitness landscape. The first ncol-1 columns correspond to a genotype table. The rows correspond to different genotypes and the columns to the mutations that are considered for these genotypes. A genotype (at a certain row) has a given mutation when there is a 1 in the corresponding column. The column to of empirical_fl correspond to the fitness of each genotype. Only the fitness of the wt (i.e. the row in the genotype table with only zeros) is used. |
model_type |
A character corresponding to one of the following implemented models :
|
fun_args |
List of argument for a given
|
... |
Extra arguments which will be passed to |
A function for generating mutants following the model from model_type
and the genotype table and the fitness of the wild type given in empirical_fl
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #random mutation in isotropic FGM
empirical_fl <- unname(cbind(as.matrix(expand.grid(rep(list(0:1), 3))), seq(0.1, 0.8, 0.1)))
model <- generate_model(empirical_fl = empirical_fl, model_type = "fgmrmut")
model(3, 0.1, 1, 1/2, 2, 3)
#selected mutation in isotropic FGM
empirical_fl <- unname(cbind(as.matrix(expand.grid(rep(list(0:1), 3))), seq(0.1, 0.8, 0.1)))
model <- generate_model(empirical_fl = empirical_fl, model_type = "fgmsmut",
fun_args = list(nb_mut_rand = 10^5))
model(3, 0.1, 1, 1/2, 2, 3)
#coselected mutation in isotropic FGM
empirical_fl <- unname(cbind(as.matrix(expand.grid(rep(list(0:1), 3))), seq(0.1, 0.8, 0.1)))
model <- generate_model(empirical_fl = empirical_fl, model_type = "fgmcsmut",
fun_args = list(nb_mut_rand = 10^5))
model(3, 0.1, 1, 1/2, 2, 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.