Learn R Programming

AFLPsim (version 0.4-2)

bayescan: Identifying candidate loci under natural selection with external application

Description

This function calls Bayescan program from within R to identifying candidate loci under natural selection from genetic data.

Usage

bayescan(mat, filename, nbp = 20, pilot = 5000, burn = 50000, exec=NULL)

Arguments

mat
A matrix with genotypic data to test in hybridsim format
filename
a character string giving the name of the output file (without extension)
nbp
Number of pilot runs (default is 2)
pilot
Length of pilot runs (default is 50)
burn
Burnin length (default is 5000)
exec
a character string giving the path to BAYESCAN. By default it tries to guess it depending on the operating system (see details).

Value

  • Several files with the results and a data.frame with the following variables:
  • probThe posterior probability for the model including selection
  • log10.PO.The logarithm of Posterior Odds to base 10
  • qvalq-values for each locus for the model including selection
  • alphaThe estimated alpha coefficient indicating the strength and direction of selection. See Bayescan 2.1 manual
  • fstThe Fst coefficient averaged over populations

encoding

latin1

Details

bayescan tries to guess the name of the executable program depending on the operating system. Specifically, the followings are used: "bayescan_2.1" under Linux and Mac, or "C:/Program Files/BayeScan2.1/binaries/BayeScan2.1_win32bits_cmd_line.exe" under Windows.

References

Foll, M. & O. Gaggiotti. 2008. A genome-scan method to identify selected loci appropriate for both dominant and codominant markers: a Bayesian perspective. Genetics 180: 977-993.

See Also

gscan sim2bayescan

Examples

Run this code
## Not run
hybrids<-hybridsim(Nmarker=100, Na=30, Nb=30, Nf1=30, type="selection", Nsel=25, hybrid="F1", S=100)
outbayes<-bayescan(hybrids, filename="bayescanresults", nbp=10, pilot=50, burn=100)
outbayes

Run the code above in your browser using DataLab