Skip to contents

This method adds a mutant and its species to the simulation.

Arguments

mutant

The mutant name.

epigenetic_rates

The epigenetic rates of the mutant species (optional).

growth_rates

The duplication rates of the mutant species.

death_rates

The death rates of the mutant species.

Details

If the optional parameter epigenetic_rate is provided, then two new species having the same mutant and opposite epigenetic states are created. When, instead, the optional parameter epigenetic_rate is missing, this method creates only one species with no epigenetic states.

Examples

# set the seed of the random number generator
set.seed(0)

# create a simulation
sim <- SpatialSimulation()

# create the two species "A+" and "A-". They both have mutant "A".
sim$add_mutant(name = "A",
               epigenetic_rates = c("+-" = 0.01, "-+" = 0.01),
               growth_rates = c("+" = 0.2, "-" = 0.08),
               death_rates = c("+" = 0.1, "-" = 0.01))

# create the species "C" its mutant is "C".
sim$add_mutant(name = "C", growth_rate = 0.2, death_rate = 0.1)