Learn R Programming

PopGenKit (version 1.0)

freqPCA: Create a table of allele frequencies from Arlequin file (.arp) that can be used directly for ordination analyses (e.g. Principal Component Analysis)

Description

This function will take a Arlequin input file (.arp) of multilocus genotypes and create a table of allele frequencies for multivariate analyses. For each locus, one allele is omitted, as it would be a redundant character for PCA analyses.

Usage

freqPCA(datafile, ndigit = 3, default.pop = T, vecpops)

Arguments

datafile
Name of the input Arlequin file, with extension (e.g. 'glyptemys3.arp').
ndigit
Number of digits per allele in input file. Can be 2 or 3. (Default is 3).
default.pop
If TRUE, population names will be taken from input file. If FALSE, they will be taken from an additional vector of population names. (Default is TRUE).
vecpops
Optional vector of population names, needed if default.pop is set to FALSE.

Value

  • Returns a table of allele frequencies formatted for PCA analysis. Also saves the table in a file placed in the working directory.

Details

Some .arp files might not be imported correctly depending on which software was used to generate them. If this is the case, start from the Genepop file and convert it first with convert.

References

Excoffier, L. and H.E.L. Lischer (2010). Arlequin suite ver 3.5: A new series of programs to perform population genetics analyses under Linux and Windows. Mol. Ecol. Res. 10: 564-567. Rousset, F. (2008). Genepop'007: a complete reimplementation of the Genepop software for Windows and Linux. Mol. Ecol. Res. 8: 103-106.