Skip to contents

This method simulates cell evolution until the number of events that have occurred to cells of a species reaches a specified threshold.

Arguments

event

The considered event, i.e., growth, death, or switch.

species

The species whose event number is considered.

num_of_events

The threshold for the event number.

quiet

An optional Boolean flag to avoid the progress bar (default: FALSE).

Examples

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

# create a simulation
sim <- SpatialSimulation()
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))
sim$place_cell("A+", 500, 500)

# simulate the cell evolution until the number of epigenetic events from
# the species "A+" is less than 100.
sim$run_up_to_event(event = "switch", species = "A+", num_of_events = 100)
#> 
 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot