calc_basic_snp_stats | R Documentation |
Automatically calculate most basic statistics from snpRdata. Calculates maf, pi, ho, he, pairwise Fst, Fis, HWE divergence, finds private alleles, and uses Gaussian smoothing to produce per-window averages of all of these.
calc_basic_snp_stats(
x,
facets = NULL,
fst.method = "WC",
sigma = NULL,
step = NULL,
par = FALSE,
nk = TRUE
)
x |
snpRdata object. |
facets |
character. Categorical metadata variables by which to break up
analysis. See |
fst.method |
character, default "WC". Defines the FST estimator to use. Options:
|
sigma |
numeric. Designates the width of windows in kilobases. Full window size is 6*sigma. |
step |
numeric or NULL, default NULL. Designates the number of kilobases between each window centroid. If NULL, windows are centered on each SNP. |
par |
numeric or FALSE, default FALSE. If numeric, the number of cores to use for parallel processing. |
nk |
logical, default TRUE. If TRUE, weights SNP contribution to window averages by the number of observations at those SNPs. |
The data can be broken up categorically by sample or SNP metadata, as
described in Facets_in_snpR
. Note that Fst and private allele
calculations require a sample specific contrast (the pairwise part of pairwise
Fst), and thus will not be calculated unless a facet with a sample meta data
variable included is specified. The other stats, in contrast, are snp-specific
and thus ignore any snp meta data variables included in facets. Providing NULL
or "all" to the facets argument works as described in
Facets_in_snpR
.
A snpRdata object with all of the described statistics merged into the appropriate sockets.
William Hemstrom
calc_single_stats calc_pairwise_fst calc_smoothed_averages
x <- calc_basic_snp_stats(stickSNPs, "pop")
get.snpR.stats(x, "pop", stats = "single") # view basic stats
get.snpR.stats(x, "pop", stats = "fst") # view fst
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.