generate_sb: Stickbreaking Model for Fitness Landscapes

Description Usage Arguments Value Examples

View source: R/generate.R

Description

Generates a fitness landscape using the stickbreaking model, as characterized in Nagel et al. (2012) <doi:10.1534.genetics.111.132134>.

Usage

1
generate_sb(n_gene, n_allele, wt_fit, mut_fit, max_fit)

Arguments

n_gene

number of genes

n_allele

number of alleles per gene

wt_fit

wild-type genotype fitness

mut_fit

if of class matrix, contains numeric fitness values for each allele and gene combination (each column is a gene, each row is an allele); if a function, must have zero parameters and return a single numeric value upon each call (it will be called repeatedly when generating the landscape)

max_fit

maximum fitness value attainable in this landscape

Value

fitness landscape stored in FitLand class object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n_gene <- 4
n_allele <- 2
wt_fit <- 1
max_fit <- 2

landscape <- generate_sb(n_gene = n_gene,
                         n_allele = n_allele,
                         wt_fit = wt_fit,
                         mut_fit = function() {stats::runif(1)},
                         max_fit = max_fit)

print(landscape)

rrrlw/fitness documentation built on Jan. 24, 2021, 3:05 a.m.