Calculate the SFS from a data frame of SNP genotypes
sfs(
x,
strata.col = 2,
locus.col = 3,
fsc.dimnames = TRUE,
sort.strata = TRUE,
na.action = c("fail", "filter")
)
a data frame of SNP genotypes where the first two columns are id and strata designations and SNPs start on the third column. SNP genotypes are coded as integers where 0 and 2 are the major and minor homozygotes and 1 is the heterozygote.
column number that strata designations are in.
column number that loci start in. All columns after this are assumed to be loci.
format matrix dimnames for fastsimcoal2? If TRUE
,
then row and column names will be prefixed with the deme number (e.g.,
"d0_") that they represent.
if joint = TRUE
, are strata to be sorted
alphabetically? If FALSE
then strata are taken in the order found in
strata.col
.
action to take if genotypes are missing for some samples.
If "fail"
, an error is thrown if any genotypes are missing. If
"filter"
, SNPs with missing genotypes are removed.
A list of the marginal (1D) and joint (2D) site frequency spectra.
If only one stratum is present, then $marginal
will be NULL
.