Learn R Programming

Ease (version 0.1.2)

mutation: Definition of a mutation

Description

Utility function to easily generate a mutation matrix (see setMutationMatrix).

Usage

mutation(from, to, rate)

Value

A standardised list of input parameters that will be used by the function setMutationMatrix to generate the mutation matrix.

Arguments

from

name of the original allele

to

name of the mutant allele

rate

rate at which the mutation occurs

Details

Mutation occurs from one allele to another at a specific rate. Please take care to define alleles as traits, that these alleles are present in the genome you are using and that the alleles are associated with the same locus.

Examples

Run this code
### Example with two loci, each with two alleles ###

# Definition of the genome
DL <- list(dl = c("A", "a"))
HL <- list(hl = c("B", "b"))
genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL)

# The mutation function allows each transition from one allele to
# another to be defined individually, to produce the mutation matrix
# as follows:
mutMatrixObj <- setMutationMatrix(genomeObj,
  mutations = list(
    mutation(from = "A", to = "a", rate = 0.1),
    mutation(from = "B", to = "b", rate = 0.1)
  )
)

Run the code above in your browser using DataLab