Skip to contents

This method generates a mutated progeny.

Arguments

cell_position

The position of the cell whose offspring will mutate.

mutated_mutant

The mutant of the mutated cell.

Details

It simulates both the duplication of the cell in the specified position and the birth of one cells of a given mutant that preserves the epigenetic status of the original cell. The mutated cell will be located in the position of its parent.

See also

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.01, "-" = 0.01))
sim$place_cell("A+", 500, 500)
sim$run_up_to_time(30)
#> 
 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot                                        


sim$add_mutant(name = "B",
               epigenetic_rates = c("+-" = 0.1, "-+" = 0.01),
               growth_rates = c("+" = 0.15, "-" = 0.3),
               death_rates = c("+" = 0.1, "-" = 0.01))

# duplicate the cell in position (503, 492). One of
# its direct descendents will have mutant "B"
# sim$mutate_progeny(503, 492, "B")

# the output of `choose_cell_in` and `get_cell` can also be used
# as input for `mutate_progeny`
sim$mutate_progeny(sim$choose_cell_in("A"), "B")