read_sfs: Read 'flattened' site frequency spectrum (SFS) from a file

Description Usage Arguments Details Value

Description

Read 'flattened' site frequency spectrum (SFS) from a file

Usage

1
2
read_sfs(ff, dims, dtype = double, bootstraps = TRUE, repolarize = FALSE,
  ...)

Arguments

ff

filename

dims

sample sizes (number of chromosomes) along each dimension of SFS

dtype

what sort of frequences to expect; best let the procedure auto-detect

bootstraps

logical; if TRUE, read bootstrap replicates (one per line) if they are present

repolarize

logical; if TRUE, swap ancestral and derived states (see Details)

...

ignored

Details

The SFS is expected to be provided in a text file as space-separated numbers (integers or floating-point), in row-major order. An unfolded SFS (ie. polarized against the derived allele) is expected, although this may be relaxed in future

NB: Recent versions of ANGSD apparently get the ancestral and derived alleles backwards. Use repolarize = TRUE to correct this issue at runtime.

Value

a site frequency spectrum (SFS): a k-dimensional array representing the joint frequencies of derived alleles in each of k populations


andrewparkermorgan/sfsr documentation built on May 10, 2019, 11:10 a.m.