vcf2dadiSNPs: Convert a vcf file to a SNPs input file for dadi

Description Usage Arguments Value See Also Examples

View source: R/vcf2dadi.R

Description

Convert a vcf file to a SNPs input file for dadi

Usage

1
2
vcf2dadiSNPs(vcf, filename = NULL, pop.list = NA, pop.map = NULL,
  whitelist = NULL, outgroup = NA)

Arguments

vcf

The vcf dataframe (from parse.vcf) or the name of the vcf file

filename

The name fo the file you want the data written to. If not provided, no file is written

pop.list

Optional list of population names. If this is provided, individuals should have the population names in their IDs. If neither pop.map or pop.list are provided, all individuals are placed in one population.

pop.map

Optional map of individual IDs in column 1 and their population names in column 2 (same as a Stacks population map). Can either be a file or an R object. If neither pop.map or pop.list are provided, all individuals are placed in one population.

whitelist

Optional list of SNPs to include in the output file. If not provided, all SNPs in the vcf will be output.

outgroup

Optional 2-column dataframe containing ingroup (column 1) and outgroup (column 2) sequences. If not provided, both will be "—".

Value

a dataframe containing the contents of the vcf file, including headers.

See Also

Gutenkunst et al. 2013

Examples

1
2
vcf.file<-system.file("extdata", "example.vcf.txt",package = "gwscaR")
dadi<-vcf2dadiSNPs(vcf.file)

spflanagan/gwscaR documentation built on Nov. 14, 2019, 9:16 p.m.