bayescan_inputs_pools: Generate 'bayescan' input files

View source: R/bayescan_inputs_pools.R

bayescan_inputs_poolsR Documentation

Generate bayescan input files

Description

Generates an input file for Bayescan (Foll & Gaggiotti, 2008) from pooled allele frequencies.

Usage

bayescan_inputs_pools(
  dat,
  pool.info,
  file.bayescan,
  file.loci,
  poolCol,
  locusCol,
  freqCol
)

Arguments

dat

Data table: The biallelic SNP data. Requires all of the following columns:

  1. The population pool ID.

  2. The locus ID.

  3. The population Ref allele frequency.

pool.info

Data table: The population pool metadata. Requires all of the following columns:

  1. $POOL = The population pool ID.

  2. $INDS = The number of diploid individuals in each pooled library.

file.bayescan

Character: The name of the input file for bayescan/

file.loci

Character: A file that contains an information about the locus ID in the bayescan input file (i.e., file.bayescan).

poolCol

Character: Population pool ID. Default = 'POOL'

locusCol

Character: Locus ID. Default = 'LOCUS'

freqCol

Character: The reference allele frequency. Default = 'FREQ'.

Details

The allele counts in the Bayescan input file generated reflect the number of haploid genomes pooled. E.g. if 20 individuals were pooled, i.e. 40 genomes, and the Ref allele was estimated at a frequency of 0.7, the counts would be Ref=28 and Alt=12. NOTE: The estimated number of indivdiuals carrying an allele is rounded to nearest integer (e.g. 1.5 = 2, and 1.4 = 1), with the exception when the number of individauls is < 1 but > 0, in which it is always rounded to 1.

References

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

Examples

library(genomalicious)

data(data_PoolFreqs)
data(data_PoolInfo)

bayescan_inputs_pools(dat=data_PoolFreqs,
pool.info=data_PoolInfo,
file.bayescan='Bayescan_input.txt',
file.loci='Bayescan_loci.txt',
poolCol='POOL',
locusCol='LOCUS',
freqCol='FREQ')


j-a-thia/genomalicious documentation built on Oct. 19, 2024, 7:51 p.m.