This function takes an igraph object and turns it into a function that takes edge weights as input, and outputs the expected f2-statistics.
graph_f2_function(
graph,
admix_default = 0.5,
drift_default = 0.01,
random_defaults = FALSE
)
An admixture graph
The default weights for admixture edges
The default weights for drift edges
Set default weights randomly for each edge between 0 and 1
A function mapping edge weights to f2-statistics
if (FALSE) {
mygraph = graph_f2_function(example_igraph)
mygraph(N3N8 = 0.1, `N2N1|Vindija.DG` = 0.4)
}