graph_to_qpadm | R Documentation |
This function tests which qpadm models should be valid for an admixture graph and a target population. By default, all models returned by qpadm_models
are tested. For large graphs this will be too slow, and you may want test only some models by providing the models
argument, or only a single model by providing the left
and right
arguments.
graph_to_qpadm(
graph,
target,
left = NULL,
right = NULL,
models = NULL,
weights = TRUE,
f4dat = NULL,
allpops = TRUE,
more_right = TRUE,
return_f4 = FALSE,
eps = 1e-10
)
graph |
An admixture graph |
target |
Name of the target population. |
left |
Left populations (provide this optionally if you want to test only a single qpadm model) |
right |
Right populations (provide this optionally if you want to test only a single qpadm model) |
models |
A two column nested data frame with models to be evaluated, one model per row. The first column, |
weights |
Set this to |
f4dat |
A data frame of f4-statistics which can be provided to override the default branch lengths. |
allpops |
Evaluate only models which use all populations in the admixture graph. See |
return_f4 |
Include f4 statistic matrices in the results (default |
eps |
Epsilon value close to zero which is used for determining which f4 matrix elements should be considered non-zero, and which weights are strictly between 0 and 1. |
Two validity criteria are tested for each qpadm model: Rank validity and weight validity. Rank validity means that the rank of the f4 statistic matrix for only left and right populations is the same as the rank of the f4 statistic matrix that includes the target population among the left populations. Weight validity means that the estimated admixture weights for all left populations are between 0 and 1.
A data frame with one qpadm model per row and columns valid_rank
and valid_weights
indicating whether a model should be valid under the graph.
An earlier version of this function tried to use the graph topology for identifying valid qpadm models, but this didn't work reliably. Christian Huber had the idea of using the ranks of expected f4 statistic matrices instead.
qpadm_models
, graph_f2_function
## Not run:
graph2 = example_igraph %>% simplify_graph() %>%
delete_admix('N3N0', 'N3N4') %>% delete_admix('N3N1', 'N3N8')
graph_to_qpadm(graph2, 'Mbuti.DG') %>% filter(valid_rank, valid_weights)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.