generate_selected_mutation: Generates 'nb_rand_mut' mutants and select 'nb_mut' among...

Description Usage Arguments Value Examples

View source: R/generate_selected_mutation.R

Description

Generates nb_rand_mut mutants and select nb_mut among them according to their selection coefficient and returns their phenotypic effects.

Usage

1
2
generate_selected_mutation(nb_mut, n, lambda, maxfitness, pheno_wt,
  alpha = 1/2, Q = 2, m = n, nb_mut_rand = 10^4)

Arguments

nb_mut

A natural number. Number of mutations in the output.

n

A natural number. Number of dimensions of the phenotypic space in which the random mutations are drawn.

lambda

A positive real number. Variance of the effect of mutations on phenotype per phenotypic dimension.

maxfitness

A real number. The maximum fitness in the landscape. The fitness at the phenotypic optimum (pheno_opt).

pheno_wt

A vector of real numbers. Phenotypic coordinates of the wild-type. Its length must be equal to the number of columns of pheno_mut_effect.

alpha

A strictly positive real number. Scaling factor for the fitness function. Default=1/2 in the cannonical FGM with a quadratic fitness function.

Q

A strictly positive number. "Shape" of the fitness function. Default=2 in the cannonical FGM with a quadratic fitness function.

m

A natural number inferior to n. Level of restricted pleiotropy which corresponds to the number of dimensions for which each mutation have a non-zero phenotypic effect. i.e. effects are equal to 0 in n-m dimensions. Default=n which corresponds to full pleiotropy.

nb_mut_rand

A natural number superior or equal to nb_mut. Number of random mutations to draw from which the mutant will be selected. This number must be large compared to nb_mut. Default=10^4.

Value

A matrix with nb_mut rows of selected mutation effects in n columns (phenotypic dimension(s)). Note that if the number of drawn beneficial mutants is inferior to nb_mut the matrix is filed with NAs. In this case nb_mut_rand must be increased.

Examples

1
2
3
generate_selected_mutation(nb_mut = 5, n = 3, lambda = 0.1, maxfitness = 1, pheno_wt = c(-1, 0, 0))
generate_selected_mutation(nb_mut = 5, n = 3, lambda = 0.1, maxfitness = 1, pheno_wt = c(-1, 0, 0),
                           alpha = 1, Q = 0.5, m = 2, nb_mut_rand = 10^5)

YoannAnciaux/inferenceFitnessLandscape documentation built on Oct. 31, 2019, 1:19 a.m.