Skip to contents

This method collects some data of the aimed cell without altering the tissue.

Arguments

x

The position of the aimed cell on the x axis.

y

The position of the aimed cell on the y axis.

Value

A dataframe reporting cell_id, mutant, epistate, position_x, and position_y of the aimed cell.

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.02, "-" = 0.01))
sim$add_mutant(name = "B",
               epigenetic_rates = c("+-" = 0.02, "-+" = 0.01),
               growth_rates = c("+" = 0.3, "-" = 0.1),
               death_rates = c("+" = 0.02, "-" = 0.01))
sim$schedule_mutation(src = "A", dst = "B", time = 50)
sim$place_cell("A+", 500, 500)
sim$run_up_to_time(40)
#> 
 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot                                 


# collect all the cells in the tissue
sim$get_cell(501, 502)
#>   cell_id mutant epistate position_x position_y
#> 1     459      A        +        501        502