View source: R/sample_schemes.r
shufflepop | R Documentation |
genclone
or
genind
object independently over each locus.Shuffle individuals in a genclone
or
genind
object independently over each locus.
shufflepop(pop, method = 1)
pop |
a |
method |
an integer between 1 and 4. See details below. |
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:
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.
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.
Non-Parametric Bootstrap This will shuffle the allelic state for each individual. Missing data is fixed in place.
Multilocus Style Permutation This will shuffle the genotypes at each locus, maintaining the heterozygosity and allelic structure.
a genclone
or genind
object
shuffled by a specified method
Zhian N. Kamvar
Paul-Michael Agapow and Austin Burt. 2001. Indices of multilocus linkage disequilibrium. Molecular Ecology Notes, 1(1-2):101-102
# 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))
## Not run:
# 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))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.