Calculate random samples of the index of association for genlight objects.
Genlight objects can contain millions of loci. Since it does not make much sense to calculate the index of association over that many loci, this function will randomly sample sites to calculate the index of association.
samp.ia(x, n.snp = 100L, reps = 100L, threads = 1L, quiet = FALSE)
the number of snps to be used to calculate standardized index of association.
the number of times to perform the calculation.
The maximum number of parallel threads to be used within this function. A value of 0 (default) will attempt to use as many threads as there are available cores/CPUs. In most cases this is ideal. A value of 1 will force the function to run serially, which may increase stability on some systems. Other values may be specified, but should be used with caution.
The index of association is a summary of linkage disequilibrium
among many loci. More information on the index of association can be found
associated with the funciton
ia. A value near or at zero
indicator of linkage equilibrium, whereas values significantly greater than
zero indicate linkage disequilibrium. However, if the observed variance in
distance among individuals is less than the expected, mildly negative
values may be observed (as the range of this index is negative one to one).
This function will call the function
reps times to calculate the index of association over
loci. The standardized index of association ('rbarD') will be calculated
reps times. These esitmates of linkage disequilibrium from random
genomic fractions can then be summarized (e.g., using a histogram) as an
estimate of genome-wide linkage disequilibrium.
This function currently only works for objects of class genlight or snpclone that are of a single ploidy level and that ploidy is either haploid or diploid.
Index of association representing the samples in this genlight object.
this will calculate the standardized index of association from Agapow
ia for details.
Zhian N. Kamvar, Jonah C. Brooks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# with structured snps assuming 1e4 positions set.seed(999) x <- glSim(n.ind = 10, n.snp.nonstruc = 5e2, n.snp.struc = 5e2, ploidy = 2, parallel = FALSE) position(x) <- sort(sample(1e4, 1e3)) res <- samp.ia(x) hist(res, breaks = "fd") # with unstructured snps assuming 1e4 positions set.seed(999) x <- glSim(n.ind = 10, n.snp.nonstruc = 1e3, ploidy = 2) position(x) <- sort(sample(1e4, 1e3)) res <- samp.ia(x) hist(res, breaks = "fd")
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.