find_graphs | R Documentation |
This function generates and evaluates admixture graphs in numgen
iterations
to find well fitting admixturegraphs.
find_graphs(
data,
numadmix = 0,
outpop = NULL,
stop_gen = 100,
stop_gen2 = 15,
stop_score = 0,
stop_sec = NULL,
initgraph = NULL,
numgraphs = 10,
mutfuns = namedList(spr_leaves, spr_all, swap_leaves, move_admixedge_once,
flipadmix_random, place_root_random, mutate_n),
opt_worst_residual = FALSE,
plusminus_generations = 5,
return_searchtree = FALSE,
admix_constraints = NULL,
event_constraints = NULL,
reject_f4z = 0,
max_admix = numadmix,
verbose = TRUE,
...
)
data |
Input data in one of three forms:
|
numadmix |
Number of admixture events within each graph. (Only relevant if |
outpop |
Name of the outgroup population |
stop_gen |
Total number of generations after which to stop |
stop_gen2 |
Number of generations without improvement after which to stop |
stop_score |
Stop once this score has been reached |
stop_sec |
Number of seconds after which to stop |
initgraph |
Graph to start with. If it is specified, |
numgraphs |
Number of graphs in each generation |
mutfuns |
Functions used to modify graphs. Defaults to the following:
|
opt_worst_residual |
Optimize for lowest worst residual instead of best score. |
plusminus_generations |
If the best score does not improve after |
return_searchtree |
Return the search tree in addition to the models. Output will be a list with three items: models, search tree, search tree as data frame |
admix_constraints |
A data frame with constraints on the number of admixture events for each population.
See |
event_constraints |
A data frame with constraints on the order of events in an admixture graph.
See |
reject_f4z |
If this is a number greater than zero, all f4-statistics with |
max_admix |
Maximum number of admixture edges. By default, this number is equal to |
verbose |
Print progress updates |
... |
Additional arguments passed to |
A nested data frame with one model per line
qpgraph
, find_graphs_old
## Not run:
res = find_graphs(example_f2_blocks, numadmix = 2)
res %>% slice_min(score)
## End(Not run)
## Not run:
# Start with a graph with 0 admixture events, increase up to 3, and stop after 10 generations of no improvement
pops = dimnames(example_f2_blocks)[[1]]
initgraph = random_admixturegraph(pops, 0, outpop = 'Chimp.REF')
res = find_graphs(example_f2_blocks, initgraph = initgraph, stop_gen2 = 10, max_admix = 3)
res %>% slice_min(score)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.