
Get the data frame of the relevant branches
Source:R/get_relevant_branches.R
get_relevant_branches.RdGet subset of forest nodes corresponding to phylogenetic branches containing relevant biological events (drivers)
Value
A data frame reporting all the forest nodes corresponding to phylogenetic branches containing relevant biological events (drivers).
Examples
# set the seed of the random number generator
set.seed(0)
sim <- TissueSimulation()
sim$add_mutant(name = "A",
growth_rates = 1,
death_rates = 0)
sim$place_cell("A", 500, 500)
sim$run_up_to_size("A",1e4)
#>
[████████████████████████████████████████] 100% [00m:00s] Saving snapshot
sim$add_mutant(name = "B",
growth_rates = 3.5,
death_rates = 0)
sim$mutate_progeny(sim$choose_cell_in("A"), "B")
sim$run_up_to_size("B",1e4)
#>
[████████████████████████████████████████] 100% [00m:00s] Saving snapshot
bbox <- sim$search_sample(c("A" = 100,"B" = 100), 50, 50)
sim$sample_cells("Sampling", bbox$lower_corner, bbox$upper_corner)
forest = sim$get_sample_forest()
get_relevant_branches(forest)
#> # A tibble: 3,935 × 8
#> cell_id ancestor depth mutant epistate sample birth_time label
#> <dbl> <int> <int> <chr> <chr> <chr> <dbl> <chr>
#> 1 0 NA 0 A "" NA 0 Truncal
#> 2 1 0 1 A "" NA 0.574 B
#> 3 4 1 2 A "" NA 0.855 B
#> 4 44 4 3 A "" NA 3.33 B
#> 5 55 44 4 A "" NA 3.62 B
#> 6 64 55 5 A "" NA 3.81 B
#> 7 74 64 6 A "" NA 4.07 B
#> 8 75 74 7 A "" NA 4.07 B
#> 9 78 75 8 A "" NA 4.09 B
#> 10 112 78 9 A "" NA 4.49 B
#> # ℹ 3,925 more rows