Skip to contents

This method retrieves information about the samples collected along the simulation.

Value

A data frame containing, for each sample collected during the simulation, the columns name, time, id, ymin, xmin, ymax, xmax, tumour_cells, and tumour_cells_in_bbox. The columns ymin, xmin, ymax, xmax report the boundaries of the sample bounding box, while tumour_cells and tumour_cells_in_bbox are the number of tumour cells in the sample and in the bounding box, respectively.

Examples

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

# create a simulation
sim <- TissueSimulation()
sim$add_mutant(name = "A",
               growth_rate = 0.2,
               death_rate = 0.01)
sim$place_cell("A", 500, 500)

sim$death_activation_level <- 100
sim$run_up_to_size(species = "A", num_of_cells = 50000)
#> 
 [███████████████████████████████████████-] 97% [00m:00s] Cells: 48630                             

 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot                         


# sample the region [450,500]x[475,550]
sim$sample_cells("S1", lower_corner=c(450,475), upper_corner=c(500,550))

# simulate 1 time unit more
sim$run_up_to_time(sim$get_clock()+1)
#> 
 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot                         


# sample the region [500,520]x[525,550]
sim$sample_cells("S2", lower_corner=c(500,525), upper_corner=c(520,550))

# get information about all the collected
# samples, i.e, S1 and S2
sim$get_samples_info()
#>   name id xmin ymin xmax ymax tumour_cells tumour_cells_in_bbox     time
#> 1   S1 11  450  475  500  550         3848                 3848 291.0345
#> 2   S2 12  500  525  520  550          519                  519 292.0371