
Utility function to easily generate a mutation matrix (see setMutationMatrix).
mutation(from, to, rate)
A standardised list of input parameters that will be used by the function setMutationMatrix to generate the mutation matrix.
name of the original allele
name of the mutant allele
rate at which the mutation occurs
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.
### 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