Learn R Programming

poppr (version 2.9.6)

shufflepop: Shuffle individuals in a genclone or genind object independently over each locus.

Description

Shuffle individuals in a genclone or genind object independently over each locus.

Usage

shufflepop(pop, method = 1)

Value

a genclone or genind object shuffled by a specified method

Arguments

pop

a genclone or genind object

method

an integer between 1 and 4. See details below.

Author

Zhian N. Kamvar

Details

This function will shuffle each locus in the data set independently of one another, rendering them essentially unlinked. The following methods are available to shuffle your data:

  1. Permute Alleles This will redistribute all alleles in the sample throughout the locus. Missing data is fixed in place. This maintains allelic structure, but heterozygosity is variable.

  2. Parametric Bootstrap This will redistribute available alleles within the locus based on their allelic frequencies. This means that both the allelic state and heterozygosity will vary. The resulting data set will not have missing data.

  3. Non-Parametric Bootstrap This will shuffle the allelic state for each individual. Missing data is fixed in place.

  4. Multilocus Style Permutation This will shuffle the genotypes at each locus, maintaining the heterozygosity and allelic structure.

References

Paul-Michael Agapow and Austin Burt. 2001. Indices of multilocus linkage disequilibrium. Molecular Ecology Notes, 1(1-2):101-102

Examples

Run this code
# load the microbov dataset
data(microbov)
# Let's look at a single population for now. Howsabout Zebu
Zebu <- popsub(microbov, "Zebu")
summary(Zebu)

# Take note of the Number of alleles per population and the Observed
# heterozygosity as we go through each method.

# Permute Alleles: maintain allelic state; heterozygosity varies.
summary(shufflepop(Zebu, method=1))
if (FALSE) {
# Parametric Bootstrap: do not maintain allelic state or heterozygosity
summary(shufflepop(Zebu, method=2))

# Non-Parametric Bootstrap: do not maintain allelic state or heterozygosity.
summary(shufflepop(Zebu, method=3))

# Multilocus Style: maintain allelic state and heterozygosity.
summary(shufflepop(Zebu, method=4))
}

Run the code above in your browser using DataLab