This function turns per-block f2-statistics into per-block f4-statistics of the form f4(pop1, pop2; pop3, pop4)
f4_from_f2(f2_data, pop1, pop2 = NULL, pop3 = NULL, pop4 = NULL)
A 3d array with blocked f2 statistics, output of f2_from_precomp
or f2_from_geno
Alternatively, a directory with precomputed data. See extract_f2
and extract_counts
.
Either the name(s) of the first population(s), or a four column matrix with the names of all four populations.
Population 2 (same length as pop1
)
Population 3 (same length as pop1
)
Population 4 (same length as pop1
)
A matrix of per-block f4-statistics (popcomb x block
)