This function computes the joint site frequency spectrum from genotype files or allele frequency and count matrices. The joint site frequency spectrum lists how often each combination of haplotypes is observed. The number of combinations is equal to the product of one plus the number of haplotypes in each population. For example, five populations with a single diploid individual each have 3^5 possible combinations.

joint_sfs(afs, pref = NULL)

Arguments

afs

A named list of length two where the first element (afs) contains the allele frequency matrix, and the second element (counts) contains the allele count matrix.

pref

Instead of afs, the prefix of genotype files can be provided.

Value

A data frame with the number of times each possible combination of allele counts is observed.

Examples

if (FALSE) {
dat = plink_to_afs('/my/plink/file', pops = c('pop1', 'pop2', 'pop3', 'pop4', 'pop5'))
joint_sfs(dat)
}