View source: R/gt_extract_f2.R
gt_extract_f2 | R Documentation |
This function prepares data for various ADMIXTOOLS 2 functions from the
package ADMIXTOOLS 2. It takes a gen_tibble
, computes allele
frequencies and blocked f2-statistics, and writes the results to outdir
. It
is equivalent to admixtools::extract_f2()
.
gt_extract_f2(
.x,
outdir = NULL,
blgsize = 0.05,
maxmem = 8000,
maxmiss = 0,
minmaf = 0,
maxmaf = 0.5,
minac2 = FALSE,
outpop = NULL,
outpop_scale = TRUE,
transitions = TRUE,
transversions = TRUE,
overwrite = FALSE,
adjust_pseudohaploid = NULL,
fst = TRUE,
afprod = TRUE,
poly_only = c("f2"),
apply_corr = TRUE,
n_cores = 1,
quiet = FALSE
)
.x |
a |
outdir |
Directory where data will be stored. |
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 |
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 |
overwrite |
Overwrite existing files in |
adjust_pseudohaploid |
Genotypes of pseudohaploid samples are usually
coded as |
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 |
n_cores |
Parallelize computation across |
quiet |
Suppress printing of progress updates |
SNP metadata (invisibly)
bed_file <-
system.file("extdata", "lobster", "lobster.bed", package = "tidypopgen")
lobsters <- gen_tibble(bed_file,
backingfile = tempfile("lobsters"),
quiet = TRUE
)
lobsters <- lobsters %>% group_by(population)
f2_path <- tempfile()
gt_extract_f2(lobsters, outdir = f2_path, quiet = TRUE)
admixtools::f2_from_precomp(f2_path, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.