Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pop_gen_sum

Population genetics summaries


Description

Functions that make population genetics summaries

Usage

gt2popsum(x, deprecated = TRUE)

gt.to.popsum(x)

Arguments

x

object of class chromR or vcfR

deprecated

logical specifying whether to run the function (FALSE) or present deprecation message (TRUE).

Details

The function 'gt2popsum' was deprecated in vcfR 1.8.0. This was because it was written entirely in R and did not perform well. Users should use 'gt.to.popsum()' instead because it has similar functionality but includes calls to C++ to increase its performance.

This function creates common population genetic summaries from either a chromR or vcfR object. The default is to return a matrix containing allele counts, He, and Ne. Allele_counts is the a comma delimited string of counts. The first position is the count of reference alleles, the second positions is the count of the first alternate alleles, the third is the count of second alternate alleles, and so on. He is the gene diversity, or heterozygosity, of the population. This is 1 - ∑ x^{2}_{i}, or the probability that two alleles sampled from the population are different, following Nei (1973). Ne is the effective number of alleles in the population. This is 1/∑ x^{2}_{i} or one minus the homozygosity, from Nei (1987) equation 8.17.

Nei, M., 1973. Analysis of gene diversity in subdivided populations. Proceedings of the National Academy of Sciences, 70(12), pp.3321-3323.

Nei, M., 1987. Molecular evolutionary genetics. Columbia University Press.

Examples

data(vcfR_test)
# Check the genotypes.
extract.gt(vcfR_test)
# Summarize the genotypes.
gt.to.popsum(vcfR_test)

vcfR

Manipulate and Visualize VCF Data

v1.12.0
GPL-3
Authors
Brian J. Knaus [cre, aut] (<https://orcid.org/0000-0003-1665-4343>), Niklaus J. Grunwald [aut] (<https://orcid.org/0000-0003-1656-7602>), Eric C. Anderson [ctb], David J. Winter [ctb], Zhian N. Kamvar [ctb] (<https://orcid.org/0000-0003-1458-7108>), Javier F. Tabima [ctb] (<https://orcid.org/0000-0002-3603-2691>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.