Learn R Programming

⚠️There's a newer version (1.16.0) of this package.Take me there.

VcfR: a package to manipulate and visualize VCF data in R

VcfR is an R package intended to allow easy manipulation and visualization of variant call format (VCF) data. Functions are provided to rapidly read from and write to VCF files. Once VCF data is read into R a parser function extracts matrices from the VCF data for use with typical R functions. This information can then be used for quality control or other purposes. Additional functions provide visualization of genomic data. Once processing is complete data may be written to a VCF file or converted into other popular R objects (e.g., genlight, DNAbin). VcfR provides a link between VCF data and the R environment connecting familiar software with genomic data.

VcfR is built upon two data structures.

vcfR - S4 class to contain data from a VCF file.

chromR - S4 class to contain variant information (VCF) and optional sequence (FASTA) and annotation (GFF) information.

Functions in vcfR provide the ability to subset VCF data as well as to extract and parse the data. For example, individual genotypes, sequence depths or genotype likelihoods (when provided in the VCF file) can easily be accessed. These tools are provided to aid researchers in rapidly surveying the quality and other characteristics of data provided as VCF data. With this information in hand, researchers should be able to determine criteria for hard filtering in order to attempt to maximize biological variation and minimize technical variation.

Publication

Knaus, Brian J., and Niklaus J. Grunwald. 2016. VcfR: an R package to manipulate and visualize VCF format data. bioRxiv: 041277. http://dx.doi.org/10.1101/041277.

Accepted pending minor revisions:

Knaus, Brian J., and Niklaus J. Grunwald. 201X. VcfR: a package to manipulate and visualize VCF data in R. Molecular Ecology Resources.

Download

While this project is in development it can be installed through github:

devtools::install_github(repo="knausb/vcfR")
library(vcfR)

If you would like the vignettes use:

devtools::install_github(repo="knausb/vcfR", build_vignettes=TRUE)

If you've built the vignettes, you can browse them with:

browseVignettes(package="vcfR")

If you've installed this package with devtools you will probably need to run:

devtools::install(build_vignettes = TRUE)

Development version

The development version (which may not be stable) can also be installed:

devtools::install_github(repo="knausb/vcfR@devel")
library(vcfR)

And to build the vignettes:

devtools::install_github(repo="knausb/vcfR@devel", build_vignettes=TRUE)

Software that produce VCF files

A fun part of this project has been learning about how people use vcfR. One facet of this is learning about the software that create VCF files. So I've decided to make a list of these software. If you know of a software that I have not included on this list, particularly if you can report that vcfR works with its files, feel free to let me know!

Genomic variant callers:

Restriction site associated DNA markers (e.g., RADseq, GBS):


Enjoy!

Copy Link

Version

Monthly Downloads

10,048

Version

1.1.0

License

GPL

Maintainer

undefined undefined undefined

Last Published

May 26th, 2016

Functions in vcfR (1.1.0)

AD_frequency

AD_frequency
chromR2vcfR

Convert chrom objects to vcfR objects
create.chromR

Create chromR object
dr.plot elements

dr.plot elements
addID

Populate the ID column of VCF data
extract.gt

Extract elements from vcfR objects
chromo_plot

Plot chromR object
show,chromR-method

chromR-method
chromR-class

chromR class
chromR functions

chromR_functions
%>%

Pipe operator
is.het

Query genotypes for heterozygotes
VCF input and output

Read and write vcf format files
write.fasta

Create fasta format output
Ranking

Ranking variants within windows
Genotype matrix functions

Genotype matrix functions
heatmap.bp

Heatmap with barplots
maf

Minor allele frequency
Process chromR objects

Process chromR object
query.gt

Query the gt slot
vcfR_example

Example data for vcfR.
show,vcfR-method

vcfR-method
Windowing

Create window summaries of data
vcfR2DNAbin

Convert vcfR to DNAbin
vcfR

Variant call format files processed with vcfR.
vcfR-class

vcfR class
write.var.info

Write summary tables from chromR objects
Format conversion

Convert vcfR objects to other formats
Convert to tidy data frames

Convert vcfR objects to tidy data frames
vcfR_test

Test data for vcfR.
%>%

Pipe operator