get.snpR.stats | R Documentation |
A convenience function that pulls statistics of any specified type at particular facets from a snpRdata object.
get.snpR.stats(x, facets = NULL, stats = "single", bootstraps = FALSE)
x |
snpRdata object. |
facets |
character or NULL, default NULL. Facets for which to fetch data. |
stats |
character or NULL, default NULL. Statistics for which to fetch data. Named identically as in the function used to calculate them (such as calc_pi). See description for list. Alternatively, a type of statistic can be requested–see description for details. |
bootstraps |
logical, default FALSE. If FALSE, bootstraps will not be returned even if they have been created for the requested statistics. Since bootstrapped datasets are often quite large, returning these may use a lot of additional memory. |
Facets are specified as described in Facets_in_snpR
. If facets
= "all", data for all facets, including the base facet, will be returned. By
default, the base facet alone will be returned.
Different statistics are returned either by named statistic or by type.
single: non-pairwise, non-window statistics (pi, ho, etc.)
pairwise: pairwise, non-window statistics (Fst).
single.window: non-pairwise, sliding window statistics.
pairwise.window: pairwise, sliding window statistics.
LD: linkage disequilibrium matrices and tables.
bootstraps: bootstraps of window statistics.
genetic_distance: genetic distances
allele_frequency_matrix: allele frequency matrices.
geo_dist: geographic distances.
ibd: isolation by distance results.
sample: sample stats.
pop: population summary statistics.
weighted.means: Weighted means of SNP statistics per facet level.
ho: Observed heterozygosity, via
calc_ho
.
pi: pi (expected number of pairwise
differences, via calc_pi
).
maf: minor allele
frequencies (and major/minor counts and identities), via
calc_maf
.
private: private allele identities, via
calc_private
.
association: results from phenotypic
association tests, via calc_association
.
hwe:
Hardy-Weinberg Equilibrium p-values, via calc_hwe
.
tajimas_d: Tajima's D, Watterson's Theta, and Tajima's Theta, via
calc_tajimas_d
.
fst: Pairwise Fst, via
calc_pairwise_fst
.
het_hom_ratio:
Heterozygote/Homozygote ratios within individuals, via
calc_het_hom_ratio
.
ne: Effective population size
estimates, via calc_ne
.
ld: Pairwise linkage
disequilibrium, via calc_pairwise_ld
.
genetic_distances: Genetic distances,
calc_genetic_distances
.
isolation_by_distance:
Genetic isolation by distance metrics, via
calc_isolation_by_distance
.
geographic_distance:
Geographic distances between samples–does not use genetic data. Calculated
during calc_isolation_by_distance
, but fetchable
independently here.
random_forest Random forest snp-specific responses, see
run_random_forest
.
William Hemstrom
# generate some statistics
dat <- calc_pi(stickSNPs, "pop")
dat <- calc_pairwise_fst(dat, "pop")
# fetch pi
get.snpR.stats(dat, "pop", "pi")
# fetch fst
get.snpR.stats(dat, "pop", "fst")
# fetch both
get.snpR.stats(dat, "pop", c("pi", "fst"))
# return a type of statistic instead of specific statistics
dat <- calc_ho(stickSNPs, "chr.pop")
get.snpR.stats(dat, "chr.pop", "weighted.means")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.