Skip to content

Instantly share code, notes, and snippets.

@edawson
Forked from sephraim/import_vcf_into_df.R
Created June 18, 2017 17:55
Show Gist options
  • Save edawson/f2337d364b619c69d81149509079b2a5 to your computer and use it in GitHub Desktop.
Save edawson/f2337d364b619c69d81149509079b2a5 to your computer and use it in GitHub Desktop.
Import VCF file into data frame in R
library(vcfR)
# Import VCF
my.vcf <- read.vcfR('my.vcf.gz')
# Combine CHROM thru FILTER cols + INFO cols
my.vcf.df <- cbind(as.data.frame(getFIX(my.vcf)), INFO2df(my.vcf))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment