Description Usage Arguments Details Value Author(s) References Examples
readGenepop
allows the calculation of various parameters from 3 digit and 2 digit genepop files. The purpose of the function is mainly as a data manipulation process to allow for easy downstream analysis.
1 | readGenepop(infile = NULL, gp = 3, bootstrap = FALSE)
|
infile |
Specifies the name of the ‘genepop’(Rousset, 2008) file from which the statistics are to be calculated. This file can be in either the 3 digit of 2 digit format, and must contain only one whitespace separator (e.g. “space" or “tab") between each column including the individual names column. The number of columns must be equal to the number of loci + 1 (the individual names column). If this file is not in the |
gp |
A numeric argument specifying the format of the |
bootstrap |
A logical argument specifying whether the user would like the |
Results from this function allow for the calculation of various population genetics statistics, such as those calculated by div.part
and in.calc
. Users may find it useful for data exploration. For instance by employing the plot {graphics}
function, an 'ad hoc' assessment of allele size distribution can be carried out using the code in the example section below.
From this example it is clear that the function will be particularly useful for those wishing to develop their own novel analysis methods.
npops |
The number of population samples in |
nloci |
The number of loci in |
pop_alleles |
A list of matrices (n = 2 x |
pop_list |
A list of matrices (n = |
loci_lames |
A character vector containing the names of loci from |
pop_pos |
A numeric vector or the row index locations of the first individual per population in |
pop_sizes |
A numeric vector of length |
allele_names |
A list of |
all_alleles |
A list of |
allele_freq |
A list containing |
raw_data |
An unaltered data frame of |
loci_harm_N |
A numeric vector of length |
n_harmonic |
A numeric value representing the harmonic mean of |
pop_names |
A character vector containing a four letter population sample name for each population in |
indtyp |
A list of length |
nalleles |
A vector of the total number of alleles observed at each locus. |
bs_file |
A genepop format data frame of bootstrapped |
Kevin Keenan <kkeenan02@qub.ac.uk>
Rousset, F., “genepop'007: a complete re-implementation of the genepop software for Windows and Linux.,” Molecular ecology resources, vol. 8, no. 1, pp. 103-6, (2008).
1 2 3 4 5 6 7 | # Code to plot ordered allele fragment sizes to assess mutation model.
data(Test_data, package = "diveRsity") # define data
x <- readGenepop(infile = Test_data, gp = 3, bootstrap = FALSE)
locus10_pop1 <- c(x$pop_alleles[[1]][[2]][,10],
x$pop_alleles[[1]][[2]][,10])
sort_order <- order(locus10_pop1, decreasing = FALSE) #sort alleles
plot(locus10_pop1[sort_order], col="red", ylab = "Allele size")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.