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.

1 |

`x` |
a |

`n.snp` |
the number of snps to be used to calculate standardized index of association. |

`reps` |
the number of times to perform the calculation. |

`threads` |
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. |

`quiet` |
if |

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 `bitwise.ia`

for
`reps`

times to calculate the index of association over `n.snp`

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
2001. See `ia`

for details.

Zhian N. Kamvar, Jonah C. Brooks

`genlight`

,
`snpclone`

,
`win.ia`

,
`ia`

,
`bitwise.dist`

`bitwise.ia`

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")
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.