This function generates an msprime simulation script, executes it in python, and turns the resulting genotype data into f2-statistics

f2_from_msprime(..., blgsize = 0.05, cleanup = TRUE, verbose = TRUE)

See also