individual_heterozygosity | R Documentation |
Calculates heterozygosity within individuals across all SNPs by either a simple ratio of heterozygous to homozygous sites or standardized for differences in genotyping success according to Coltman et al (1999).
calc_het_hom_ratio(x, facets = NULL, complex_averages = FALSE)
calc_hs(x, facets = NULL, complex_averages = FALSE)
x |
snpRdata object |
facets |
facets over which to split snps within samples. Takes only SNP
level facets. See |
complex_averages |
logical, default FALSE. If TRUE, will compute weighted averages for complex (snp + sample metadata) facets. This can be quite time consuming, and so is generally not recommended unless needed. |
A snpRdata object with heterozygote/homozygote ratios merged into the sample.stats slot.
calc_het_hom_ratio()
: Ratio of heterozygous to homozygous sites.
calc_hs()
: HS, Individual Heterozygosity
Hom ratio:
Individual heterozygosity calculated as the number of heterozygous sites divided by the number of homozygous sites.
Calculates HS, the mean heterozygosity of an individual standardized for unequal genotyping across individuals by dividing by the mean heterozygosity across all individuals *for the loci sequenced in that individual* (Coltman et al 1999). As a result, the global mean HS should be roughly equal to 1, and that in 'snpR' specifically the denominator is calculated across *all individuals in all facet levels* if facets are specified instead of within populations. As a result, the weighted mean HS in a specific population can be substantially different from one if a population is much less heterozygous.
William Hemstrom
Coltman, D. W., Pilkington, J. G., Smith, J. A., & Pemberton, J. M. (1999). Parasite-mediated selection against inbred Soay sheep in a free-living, island population. Evolution, 53(4), 1259–1267. doi: 10.1111/j.1558-5646.1999.tb04538.x
# base facet
x <- calc_het_hom_ratio(stickSNPs)
get.snpR.stats(x, stats = "het_hom_ratio")
# facet by chromosome
x <- calc_het_hom_ratio(stickSNPs, "chr")
get.snpR.stats(x, "chr", stats = "het_hom_ratio")
# Getting population means:
x <- calc_hs(stickSNPs, "pop")
get.snpR.stats(x, "pop", stats = "hs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.