Learn R Programming

dartR (version 0.80)

gl.fixed.diff: Generate a matrix of fixed differences from a genelight or genind object {adegenet}

Description

This script takes SNP data grouped into populations in a genlight object (DArTSeq) or presence absence data (SilicoDArT) grouped into populations in a genind object and generates a matrix of fixed differences between populations taken pairwise

Usage

gl.fixed.diff(gl, t = 0, probar = FALSE)

Arguments

gl

-- name of the genlight object containing SNP genotypes or a genind object containing presence/absence data [required]

t

-- threshold value for tollerance in when a difference is regarded as fixed

probar

-- switch to output progress bar [default is false]

Value

Matrix of fixed differences

Details

A fixed difference at a locus occurs when two populations share no alleles. The challenge with this approach is that when sample sizes are finite, fixed differences will occur through sampling error, compounded when many loci are examined. Simulations suggest that sample sizes of n1=5 and n2=5 is adequate to reduce the probability of [experiment-wide] type 1 error to negligible levels [ploidy=2]. A warning is issued if comparison between two populations involves sample sizes less than 5, taking into account allele drop-out.

Tollerance in the definition of a fixed difference is provided by the t parameter. For example, t=0.05 means that SNP allele frequencies of 95,5 and 5,95 percent will be regarded as fixed.

See Also

is.fixed

Examples

Run this code
# NOT RUN {
#only used the first 20 individuals due to runtime reasons 
mat <- gl.fixed.diff(testset.gl[1:20,], t=0.05)
mat
# }

Run the code above in your browser using DataLab