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
)

Arguments

graph

An admixture graph

admix_default

The default weights for admixture edges

drift_default

The default weights for drift edges

random_defaults

Set default weights randomly for each edge between 0 and 1

Value

A function mapping edge weights to f2-statistics

Examples

if (FALSE) {
mygraph = graph_f2_function(example_igraph)
mygraph(N3N8 = 0.1, `N2N1|Vindija.DG` = 0.4)
}