Learn R Programming

vcfR (version 1.0.0)

Format conversion: Convert vcfR objects to other formats

Description

Convert vcfR objects to objects supported by other R packages

Usage

vcfR2genind(x, sep = "[|/]")

vcfR2loci(x)

vcfR2genlight(x)

Arguments

x
an object of class chromR or vcfR
sep
character (to be used in a regular expression) to delimit the alleles of genotypes

Details

After processing vcf data in vcfR, one will likely proceed to an analysis step. Within R, three obvious choices are: http://cran.r-project.org/package=pegas{pegas}, http://cran.r-project.org/package=adegenet{adegenet} and http://cran.r-project.org/package=poppr{poppr}. The package pegas uses objects of type loci. The function vcfR2loci calls extract.gt to create a matrix of genotypes which is then converted into an object of type loci.

The packages adegenet and poppr use the genind object. The function vcfR2genind uses extract.gt to create a matrix of genotypes and uses the adegenet function df2genind to create a genind object. The package poppr additionally uses objects of class genclone which can be created from genind objects using poppr::as.genclone. A genind object can be converted to a genclone object with the function poppr::as.genclone.

See Also

extract.gt, df2genind, genind, http://cran.r-project.org/package=pegas{pegas}, http://cran.r-project.org/package=adegenet{adegenet}, and http://cran.r-project.org/package=poppr{poppr}. To convert to objects of class DNAbin see vcfR2DNAbin.