| extract_f2 | R Documentation | 
This function prepares data for various other ADMIXTOOLS 2 functions. It reads data from genotype files,
computes allele frequencies and blocked f2-statistics for selected populations, and writes the results to outdir.
extract_f2(
  pref,
  outdir,
  inds = NULL,
  pops = NULL,
  blgsize = 0.05,
  maxmem = 8000,
  maxmiss = 0,
  minmaf = 0,
  maxmaf = 0.5,
  minac2 = FALSE,
  pops2 = NULL,
  outpop = NULL,
  outpop_scale = TRUE,
  transitions = TRUE,
  transversions = TRUE,
  auto_only = TRUE,
  keepsnps = NULL,
  overwrite = FALSE,
  format = NULL,
  adjust_pseudohaploid = TRUE,
  cols_per_chunk = NULL,
  fst = TRUE,
  afprod = TRUE,
  poly_only = c("f2"),
  apply_corr = TRUE,
  qpfstats = FALSE,
  n_cores = 1,
  verbose = TRUE,
  ...
)
pref | 
 Prefix of PLINK/EIGENSTRAT/PACKEDANCESTRYMAP files.
EIGENSTRAT/PACKEDANCESTRYMAP have to end in   | 
outdir | 
 Directory where data will be stored.  | 
inds | 
 Individuals for which data should be extracted  | 
pops | 
 Populations for which data should be extracted. If both   | 
blgsize | 
 SNP block size in Morgan. Default is 0.05 (5 cM). If   | 
maxmem | 
 Maximum amount of memory to be used. If the required amount of memory exceeds   | 
maxmiss | 
 Discard SNPs which are missing in a fraction of populations higher than   | 
minmaf | 
 Discard SNPs with minor allele frequency less than   | 
maxmaf | 
 Discard SNPs with minor allele frequency greater than than   | 
minac2 | 
 Discard SNPs with allele count lower than 2 in any population (default   | 
pops2 | 
 If specified, only a pairs between   | 
outpop | 
 Keep only SNPs which are heterozygous in this population  | 
outpop_scale | 
 Scale f2-statistics by the inverse   | 
transitions | 
 Set this to   | 
transversions | 
 Set this to   | 
auto_only | 
 Keep only SNPs on chromosomes 1 to 22  | 
keepsnps | 
 SNP IDs of SNPs to keep. Overrides other SNP filtering options  | 
overwrite | 
 Overwrite existing files in   | 
format | 
 Supply this if the prefix can refer to genotype data in different formats
and you want to choose which one to read. Should be   | 
adjust_pseudohaploid | 
 Genotypes of pseudohaploid samples are usually coded as   | 
cols_per_chunk | 
 Number of allele frequency chunks to store on disk. Setting this to a positive integer makes the function slower, but requires less memory. The default value for   | 
fst | 
 Write files with pairwise FST for every population pair. Setting this to FALSE can make   | 
afprod | 
 Write files with allele frequency products for every population pair. Setting this to FALSE can make   | 
poly_only | 
 Specify whether SNPs with identical allele frequencies in every population should be discarded (  | 
apply_corr | 
 Apply small-sample-size correction when computing f2-statistics (default   | 
qpfstats | 
 Compute smoothed f2-statistics (default   | 
n_cores | 
 Parallelize computation across   | 
verbose | 
 Print progress updates  | 
... | 
 Pass arguments to   | 
SNP metadata (invisibly)
f2_from_precomp for reading the stored f2-statistics back
into R, f2_from_geno to skip writting f2-statistics to disk and return them directly
## Not run: 
pref = 'my/genofiles/prefix'
f2dir = 'my/f2dir/'
extract_f2(pref, f2dir, pops = c('popA', 'popB', 'popC'))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.