vcf2genind: Fast conversion of vcf to genind

Description Usage Arguments Value Examples

Description

This function converts a raw vcf file to a genind object with the assumptions that (1) the ploidy is 2 (but will work with one actually, but not with ploidy > 2) and (2) marker is codominant (duhhhhhh, it should be!!!) this basically creates an allele frequency table from the vcf which is the used as the tab in a genind object. Then, the output is wrapped using the genind function from adegenet together with other auxillary information.

Usage

1
2
3
vcf2genind(filePath = NULL, inputData = NULL, pop = NULL,
  prevcall = NULL, ploidy = NULL, type = "codom", strata = NULL,
  hierarchy = NULL)

Arguments

filePath

full path to the vcf file; this calls the vcfLoad

pop

vector of the the popID of each sample

dataIn

data.table obtained using vcfLoad function

...

other parameters needed by genind type object, see genind or df2genind

Value

A genind class object to be used by adegenet

Examples

1
2
3
4
# reads the example.vcf and makes a genind object
vcfGenind <- vcf2genind("example.vcf")
populationData <- read.table("populationMetadata")
findfixedSNP(dataIn = vcfInput, popinfo = populationData)

dinmatias/reconproGS documentation built on May 19, 2019, 1:43 a.m.