initialize.multilocus: Initialize multilocus simulations

Description Usage Arguments Value Author(s) Examples

View source: R/Multilocus.R

Description

Function used to initialize multilocus simulations.

Usage

1
2
3
4
5
6
7
8
initialize.multilocus(allele_vec,
                      r,
                      mu=rep(0,length(allele_vec)),
                      n,
                      z,
                      kappa0,
                      init.state="fixed",
                      sexuality=NULL)

Arguments

allele_vec

Vector giving the number of alleles at each locus.

r

Recombination rate. A single value between 0 and 0.5. For more than two loci, recombination rate must be set to 0.5.

mu

Vector giving the mutation rate for each locus, i.e. the probability that an allele mutate to a different allele.

n

Number of demes.

z

Number of age classes.

kappa0

Initial number of individuals per deme. This is used to assign individuals to genotype and age-classes in each deme according to the criterion defined in "init.state". Because the assignment involves rounding, the realized number of individuals might be different than the one set by the user.

init.state

String defining the genetic composition of the initial population. If "fixed", all genotypes and age-classes will have the same number of individuals. If "random", numbers of individuals will be assigned randomly.

sexuality

One of "monoecious" or "dioecious", defining the sexuality of the modelled species.

Value

A list with the following items:

r

The recombination rate input by the user

mu

The vector of mutation rates input by the user

m

The number of multilocus genotypes

n

The number of demes input by the user

z

The number of age-classes input by the user

kappa0

The initial number of individuals per deme given by the user

index_matr

The index of the multilocus genotypes given by the function genotype.index.multilocus

meiosis_matrix

A matrix giving the probabilities of producing multilocus gametes (rows) for each multilocus genotype (columns)

mat_geno_to_index_mapping

A square matrix giving the genotype index for each combination of female (rows) and male (columns) multilocus gametes

N1

The initial composition of the population as a 3D array giving the number of individuals of each genotype (first dimension) in each deme (second dimension) in each age-class (third dimension)

Author(s)

Marco Andrello

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
allele_vec <- c(2,2)
init.par <- initialize.multilocus(allele_vec=allele_vec,
                                  r=0.5,
                                  mu=c(0.01,0.01),
                                  n=3,
                                  z=1,
                                  kappa0=100,
                                  sexuality="monoecious")


## End(Not run)

MarcoAndrello/MetaPopGen-2.0 documentation built on Nov. 25, 2020, 11:20 p.m.