RxpHetero: Calculate Real or Expected Average Heterozygosity at each...

Description Usage Arguments Details Value References Examples

View source: R/RxpHetero.R

Description

Calculate Real or Expected Average Heterozygosity at each locus

Usage

1
RxpHetero(h,p,HWE)

Arguments

h

a dataset of heterozygosity, made up with 0 and 1. Output of function "Heterozygous". Each row denotes each individual. Each row denotes each locus.

p

a dataset of allele frequency, Output of function "AlleleFreq". Each row denotes each allele, and each column denotes each locus.

HWE

a logic variable. When TRUE, this function will calculate the expected heterozygosity under Hardy-Weinberg Equilibrium: H= 1-sum(q_i^2); q_i is the allele frequency; If FALSE, this function calculate the average heterozygosity from real heterozygosity table.

Details

This function calculate average heterozygosity at each locus.Output a vector of number of loci.

Value

a vector of average heterozygosity on each loci.

References

Chakraborty, R., & Jin, L. (1992, ISSN:1432-1203) <doi:10.1007/BF00197257>

Examples

1
2
3
4
5
6
7
8
x <- data.frame(STR1=c(12,13,13,14,15,13,14,12,14,15),
               STR1_1=c(12,14,13,15,13,14,13,12,14,15),
               SNP1=c("A","T","A","A","T","A","A","T","T","A"),
               SNP1_1=c("A","T","T","T","A","T","A","A","T","T"))
require(mixIndependR)
h <- Heterozygous(x)
p <- AlleleFreq(x)
RxpHetero(h,p,HWE=TRUE)

mixIndependR documentation built on March 17, 2021, 5:09 p.m.