gl2sfs: Convert a genlight object into a sfs input file

View source: R/fastsimcoal.R

gl2sfsR Documentation

Convert a genlight object into a sfs input file

Description

The output of this function is suitable for analysis in fastsimcoal2 or dada.

Usage

gl2sfs(gl, outfile_root = "gl2sfs", outpath = tempdir())

Arguments

gl

the genlight object

outfile_root

The root of the name of the output file

outpath

The output path where to save the file

Details

It saves a derived sfs, assuming that the reference allele is the ancestral, and a MAF sfs.

At this stage this function caters only for diploid organisms, for samples from one population only, and for genotypes without missing data.

It expects a dartR formatted genlight object, but will work with other gl as long as the have a data.frame in other called loc.metrics with a column named TrimmedSequence that contains a character string whose length corrensponds to the number of sites of the allele. This information is used to obtained the number of non-polymorphic sites.

TO-DO: deal with missing data. See http://evomics.org/learning/population-and-speciation-genomics/2018-population-and-speciation-genomics/fastsimcoal2-activity/

References

Excoffier L., Dupanloup I., Huerta-Sánchez E., Sousa V. C. and Foll M. (2013) Robust demographic inference from genomic and SNP data. PLoS genetics 9(10)


carlopacioni/amplicR documentation built on Aug. 19, 2023, 7:59 p.m.