grab_vcf: read in a (possibly gzipped) VCF file and return it as a data...

Description Usage Arguments Examples

View source: R/functions.R

Description

This scans a VCF file to find the header line (by searching for a line starting with "#CHROM"), and then it reads it in and returns it as a data frame. It doesn' worry about the formatting of the genotype columns because we are typically concerned here just with getting CHROM, POS, REF, and ALT. In fact, by default, those four columns are all that this function returns

Usage

1
grab_vcf(path, all_cols = FALSE, top_test = 200)

Arguments

path

The path to a VCF file (which may or may not be gzipped)

all_cols

Logical indicating whether to return all columns (TRUE) or only CHROM, POS, REF, and ALT.

top_test

How many lines to scan from the top of the file to look for the "#CHROM" showing that it is the header.

Examples

1
grab_vcf(system.file("textdata", "vcf.txt.gz", package = "snps2assays"))

eriqande/snps2assays documentation built on Oct. 9, 2020, 5:22 p.m.