gl2bayescan: Converts a genlight object into a format suitable for input...

View source: R/gl2bayescan.r

gl2bayescanR Documentation

Converts a genlight object into a format suitable for input to Bayescan

Description

The output text file contains the SNP data and relevant BayeScan command lines to guide input.

Usage

gl2bayescan(x, outfile = "bayescan.txt", outpath = NULL, verbose = NULL)

Arguments

x

Name of the genlight object containing the SNP data [required].

outfile

File name of the output file (including extension) [default bayescan.txt].

outpath

Path where to save the output file [default global working directory or if not specified, tempdir()].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, adopting the global verbosity set by gl.set.verbosity(), or 2 if no global is set].

Details

The output follows BayeScan's codominant (GESTE) format: for each population, one row per locus giving the number of gene copies sampled, the number of alleles (2), and the counts of the alternate and reference alleles. A population x locus combination with no genotyped individuals is written as a sample of zero gene copies; a warning reports how many such rows were written. Filtering on call rate (gl.filter.callrate) before export is recommended to avoid empty samples.

Value

returns no value (i.e. NULL), invisibly

Author(s)

Author(s): Luis Mijangos. Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr

References

Foll M and OE 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

Other linker: gi2gl(), gl2bayesAss(), gl2bpp(), gl2demerelate(), gl2eigenstrat(), gl2faststructure(), gl2gapit(), gl2gds(), gl2genalex(), gl2genepop(), gl2geno(), gl2gi(), gl2hapmap(), gl2hiphop(), gl2related(), gl2snapper(), gl2structure(), gl2treemix(), gl2vcf()

Examples

if (isTRUE(getOption("dartR_fbm"))) testset.gl <- gl.gen2fbm(testset.gl)
out <- gl2bayescan(testset.gl, outpath = tempdir())


dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.