pooldata2diyabc: Convert a pooldata object into DIYABC input files.

View source: R/pooldata2diyabc.R

pooldata2diyabcR Documentation

Convert a pooldata object into DIYABC input files.

Description

Convert a pooldata object into DIYABC data file for pool-seq data. A file containing SNP details is also printed out. Options to generate sub-samples (e.g., for large number of SNPs) are also available. Note that DIYABC SNP filtering criterion is based on MRC (minimal read count) which may be more stringent than usual MAF-based filtering criterion. It is recommended to parse vcf files and pooldata objects without any MAF criterion or to prefilter pooldata objects with the desired MRC (using option snp.index pooldata.subset).

Usage

pooldata2diyabc(
  pooldata,
  writing.dir = getwd(),
  prefix = "",
  diyabc.mrc = 1,
  subsamplesize = -1,
  subsamplingmethod = "thinning"
)

Arguments

pooldata

A pooldata object containing Pool-Seq information (see vcf2pooldata and popsync2pooldata)

writing.dir

Directory where to create the files (e.g., set writing.dir=getwd() to copy in the current working directory)

prefix

Prefix used for output file names

diyabc.mrc

MRC to be applied by DIYABC (note that no filtering based on MRC is done by the function)

subsamplesize

Size of the sub-samples. If <=1 (default), all the SNPs are considered in the output

subsamplingmethod

If sub-sampling is activated (argument subsamplesize), define the method used for subsampling that might be either i) "random" (A single data set consisting of randmly chosen SNPs is generated) or ii) "thinning", sub-samples are generated by taking SNPs one every nsub=floor(nsnp/subsamplesize) in the order of the map (a suffix ".subn" is added to each sub-sample files where n varies from 1 to nsub).

Value

DIYABC data file for pool-seq data

See Also

To generate pooldata object, see vcf2pooldata, popsync2pooldata

Examples

 make.example.files(writing.dir=tempdir())
 pooldata=popsync2pooldata(sync.file=paste0(tempdir(),"/ex.sync.gz"),poolsizes=rep(50,15))
 pooldata2diyabc(pooldata=pooldata,writing.dir=tempdir())

poolfstat documentation built on Sept. 8, 2023, 5:49 p.m.