basicStats: Claculate basic descriptive population parameters from a...

Description Usage Arguments Details Value Author(s) References Examples

Description

A new and improved version of divBasic, with a more comprehensive set of control arguments, as well as better memory and CPU efficiency. Additional options for testing homozygosity/heterozygosity excess are also provided.

Usage

1
2
3
4
basicStats(infile = NULL, outfile = NULL, fis_ci = FALSE,
           ar_ci = FALSE, fis_boots = NULL, ar_boots = NULL, 
           mc_reps = 9999, rarefaction = TRUE, ar_alpha = 0.05, 
           fis_alpha = 0.05)

Arguments

infile

Specifying 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 working directory the file path must be given. The name must be a character string (i.e. enclosed in “” or '').

outfile

A character string specifying the name to be given to the output tab delimited file. Default value of NULL means that no file is written.

fis_ci

A logical argument specifying whether confidence limits should be calculated for the inbreeding coefficient.

ar_ci

A logical argument specifying whether confidence limits should be calculated for resampleed allelic richness. Only valid when rarefaction = FALSE.

fis_boots

An integer specifying the number of bootstrap replicate used to calculate confidence limits for the inbreeding coefficient if fis_ci = TRUE

ar_boots

An integer specifying the number of bootstrap replicate used to calculate confidence limits for allelic richness if ar_ci = TRUE and rarefaction = FALSE

mc_reps

An integer specifying the number of Monte Carlo replicates used when carrying out psudo-exact HWE tests

rarefaction

A logical indicating whether allelic richness should be calculated using rarefaction. If FALSE user should specify the number of ar_boots to use when estimating allelic richness using the resample method

ar_alpha

A numeric argument specifying the alpha used to calculate the confidence interval for resample based allelic richness. Valid if rarefaction = FALSE, ar_boots > 2 and ar_ci = TRUE. Confidence limits are defined as alpha/2 and 1-(alpha/2).

fis_alpha

A numeric argument specifying the alpha used to calculate the confidence interval for resample based allelic richness. Valid if fis_boots > 2 and fis_ci = TRUE. Confidence limits are defined as alpha/2 and 1-(alpha/2).

Details

HWE tests are carried out using methods originally implemented in the package HWxtest. Test of HWE proportions are either carried out using either exact testing (when the number of genotype tables is less than 10 million), or through Monte Carlo simulations, where the number of random trials can be specified using the argument mc_reps. HWE tests will also be automatically carried out to assess homozygosity/hetrozygosity excess (i.e. one tailed tests). The test results returned is automatically determined by the proporties of the original data. See ?HWx.test for more details.

Value

A list of results

Author(s)

Kevin Keenan <kkeenan02@qub.ac.uk>

References

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).

Bill Engels (2014). HWxtest: Exact Tests for Hardy-Weinberg Proportions. R package version 1.0.5. http://CRAN.R-project.org/package=HWxtest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# To run an example use the following format
library("diveRsity")
data(Test_data)
test_results <- basicStats(infile = Test_data, outfile = "test_run", 
                           fis_ci = TRUE, ar_ci = TRUE, fis_boots = 999, 
                           ar_boots = 999, mc_reps = 9999, 
                           rarefaction = FALSE, ar_alpha = 0.05, 
                           fis_alpha = 0.05)

## End(Not run)

diveRsity documentation built on May 1, 2019, 10:30 p.m.