View source: R/UserFunctions.R
mutation | R Documentation |
Utility function to easily generate a mutation matrix (see setMutationMatrix).
mutation(from, to, rate)
from |
name of the original allele |
to |
name of the mutant allele |
rate |
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.
A standardised list of input parameters that will be used by the function setMutationMatrix to generate the mutation matrix.
### 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) ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.