R/slimr_output.R
r_output_nucleotides.Rd
Utility function to tell SLiM to output Nucleotides
r_output_nucleotides(
name = "seqs",
subpops = FALSE,
both_genomes = FALSE,
inds = NULL,
...
)
slimr_output_nucleotides(
name = "seqs",
subpops = FALSE,
both_genomes = FALSE,
inds = NULL,
...
)
Name of output to use to label it in slimr_results object
. Default is "seqs"
.
Should the subpopulation of each sequence be outputted as well?
Should both genomes be outputted? If `FALSE` only nucleotides from genome1 are outputted
SLiM expression that returns the individuals to get nucleotides from. By default all individuals are returned.
Other arguments to be passed to r_output
None
test_sim <- slim_script(
slim_block(initialize(), {
## tell SLiM to simulate nucleotides
initializeSLiMOptions(nucleotideBased=T);
initializeAncestralNucleotides(randomNucleotides(1000));
initializeMutationTypeNuc("m1", 0.5, "f", 0.0);
initializeGenomicElementType("g1", m1, 1.0, mmJukesCantor(1e-5));
initializeGenomicElement(g1, 0, 1000 - 1);
initializeRecombinationRate(1e-8);
}),
slim_block_add_subpops(1, 100),
slim_block(1, 20, late(), {
r_output_nucleotides("out", do_every = 10)
})
)
test_sim
#> <slimr_script[3]>
#> block_init:initialize() {
#> initializeSLiMOptions(nucleotideBased = T);
#> initializeAncestralNucleotides(randomNucleotides(1000));
#> initializeMutationTypeNuc("m1", 0.5, "f", 0);
#> initializeGenomicElementType("g1", m1, 1, mmJukesCantor(1e-05));
#> initializeGenomicElement(g1, 0, 1000 - 1);
#> initializeRecombinationRate(1e-08);
#> }
#>
#> block_2:1 early() {
#> sim.addSubpop("p1", 100);
#> }
#>
#> block_3:1:20 late() {
#> {paste(sim.subpopulations.individuals.genome1.nucleotides()) -> out}
#> }