Extract Elements from SLiM's outputFull()

slim_extract_full(
  output_full,
  type = c("mutations", "individuals", "genomes", "coordinates", "sexes", "ages",
    "full_individual"),
  join = TRUE,
  expand_mutations = FALSE
)

Arguments

output_full

A character vector where each element is the result of a call to outputFull() in SLiM

type

Which type of data to return: "mutations", "individuals", "genomes", "coordinates", "sexes", or "ages"

join

If asking for multiple output type, should they be joined into one tibble (join = TRUE) or left as separate tibbles returned in a list (join = FALSE)?

expand_mutations

If asking for "genomes" output, should mutations be expanded into their own column (expand_mutations = TRUE) or left as a vector of mutation ids in a list column (expand_mutations = FALSE)?

Value

A tibble

Examples

if(slim_is_avail()) {
  test_sim <- slim_script(
    slim_block_init_minimal(mutation_rate = 1e-6),
    slim_block_add_subpops(1, 100),
    slim_block(1, 20, late(), {
      r_output(sim.outputFull(), "out", do_every = 10)
    })
  ) %>%
    slim_run()
  slim_extract_full(test_sim$output_data, type = "mutations")
}
#> 
#> 
#> Simulation finished with exit status: 0
#> 
#> Success!
#> # A tibble: 178 × 11
#>    generation mut_id unique_mut_id mut_type chrome_pos selection dominance
#>         <int>  <int>         <int> <chr>         <int>     <dbl>     <dbl>
#>  1         10     34             1 m1            49445         0       0.5
#>  2         10     13             7 m1            32572         0       0.5
#>  3         10      6            17 m1            95907         0       0.5
#>  4         10      3            38 m1            98747         0       0.5
#>  5         10     24            43 m1             4281         0       0.5
#>  6         10     25            48 m1             6378         0       0.5
#>  7         10     51            55 m1            10571         0       0.5
#>  8         10     12            56 m1            17226         0       0.5
#>  9         10     50            58 m1            57418         0       0.5
#> 10         10     32            66 m1            47339         0       0.5
#> # ℹ 168 more rows
#> # ℹ 4 more variables: subpop <chr>, first_gen <int>, prevalence <int>,
#> #   nucleotide <chr>