random_sim | R Documentation |
This is basically a wrapper function around the msprime_genome
that allows user to create a random graph and simulate it in msprime v1.x.
random_sim(
nleaf,
nadmix,
outpref = "random_sim",
max_depth = NULL,
ind_per_pop = 1,
mutation_rate = 1.25e-08,
admix_weights = 0.5,
neff = 1000,
time = 1000,
fix_leaf = FALSE,
outpop = NULL,
nchr = 1,
recomb_rate = 2e-08,
seq_length = 1000,
ghost_lineages = TRUE,
run = FALSE
)
nleaf |
The number of leaf nodes |
nadmix |
The number of admixture events |
outpref |
A prefix of output files |
max_depth |
A constraint specifying the maximum time depth of the admixture graph (in generations) |
ind_per_pop |
The number of individuals to simulate for each population. If a scalar value, it will be constant across all populations. Alternatively, it can be a named vector with a different value for each population. |
mutation_rate |
Mutation rate per site per generation. The default is |
admix_weights |
Admixture weights. If a float value (0 < value < 1), admixture weights for each admixture event will be (value, 1-value).
Alternatively, it can be a range, i.e., |
neff |
Effective population size (in diploid individuals). If a scalar value, it will be constant across all populations. Alternatively, it can be a range, i.e., |
time |
Time between nodes. Either a scalar value (1000 by default) with the dates generated by |
fix_leaf |
A boolean specifying if the dates of the leaf nodes will be fixed at time 0. If |
outpop |
A name of the (optional) outgroup population. |
nchr |
The number of chromosomes to simulate |
recomb_rate |
A float value specifying recombination rate along the chromosomes. The default is |
seq_length |
The sequence length of the chromosomes. If it is a scalar value, the sequence length will be constant for all chromosomes.
Alternatively, it can be a vector with a length equal to number of chromosomes (i.e., |
ghost_lineages |
A boolean value specifying whether ghost lineages will be allowed.
If |
run |
If |
A list with the path of simulation script, a data frame of graph edges, dates and population sizes:
out - A file name and path of the simulation script
edges - An edge dataframe with admixture weights
dates - A named vector with a date for each node
neffs - A named vector with an effective population size for each node
# Create simulation script that simulates 2 chromosomes that are 50base long
# where maximum depth of the tree is 5000 generations, and plot the output graph
## Not run:
out = random_sim(nleaf=4, nadmix=0, max_depth=5000, nchr=2, seq_length=50)
plot_graph(out$edges, dates = out$dates, neff = out$neff, hide_weights = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.