eigenstrat_to_afs: Read allele frequencies from _EIGENSTRAT_ files

Description Usage Arguments Value Examples

View source: R/io.R

Description

Read allele frequencies from EIGENSTRAT files

Usage

1
2
3
4
5
6
7
eigenstrat_to_afs(
  pref,
  inds = NULL,
  pops = NULL,
  adjust_pseudohaploid = TRUE,
  verbose = TRUE
)

Arguments

pref

Prefix of EIGENSTRAT files (files have to end in .geno, .ind, .snp)

inds

Individuals from which to compute allele frequencies

pops

Populations from which to compute allele frequencies. If NULL (default), populations will be extracted from the third column in the .ind file. If population labels are provided, they should have the same length as inds, and will be matched to them by position

adjust_pseudohaploid

Genotypes of pseudohaploid samples are usually coded as 0 or 2, even though only one allele is observed. adjust_pseudohaploid ensures that the observed allele count increases only by 1 for each pseudohaploid sample. If TRUE (default), samples that don't have any genotypes coded as 1 among the first 1000 SNPs are automatically identified as pseudohaploid. This leads to slightly more accurate estimates of f-statistics. Setting this parameter to FALSE is equivalent to the ADMIXTOOLS inbreed: NO option.

verbose

Print progress updates

Value

A list with three data frames: allele frequency data, allele counts, and SNP metadata

Examples

1
2
3
4
5
6
## Not run: 
afdat = eigenstrat_to_afs(prefix, pops = pops)
afs = afdat$afs
counts = afdat$counts

## End(Not run)

uqrmaie1/admixtools documentation built on Sept. 16, 2020, 5:55 a.m.