read_vcf: Read and write VCF tables

Description Usage Arguments Value References

Description

Read and write VCF tables

Usage

1
2
3
read_vcf(file, col_types = NULL, callback = NULL, chunk_size = 1e+06, ...)

write_vcf(vcf, file)

Arguments

file

[character(1)] Path to VCF file. Supported file extensions: .vcf, .vcf.gz, .vcf.bz2. Compressed files are unzipped for the duration of the R session via R.utils::gunzip, or R.utils::bunzip2. write_vcf only supports .vcf.

col_types

[col_spec|character(1)|NULL] Either NULL, or a valid column specification (for more details, see readr::read_tsv). Defaults to only read the following expected VCF columns:

- CHROM [character]
- POS [integer]
- ID [character]
- REF [character]
- ALT [character]
- QUAL [double]
- FILTER [character]
- INFO [character]
callback

[function(x, pos)|NULL] A function with arguments x and pos that takes a dataframe as x and returns a dataframe (pos is used internally). This is usefull for filtering or summarizing VCF files that are otherwise too big to read into memory. See readr::DataFrameCallback and readr::read_tsv_chunked for examples. Defaults to NULL.

chunk_size

[integer(1)] Number of lines to read for each chunk when using a callback. Defaults to 1e6.

...

Arguments passed to readr::read_tsv, or readr::read_tsv_chunked if callback is not NULL.

vcf

[vcf] A VCF data frame. Simply a data frame with a vcf class and an attribute that contains VCF header information.

Value

An object with class vcf (inherits data.frame class). VCF header information is stored as an attribute accessible via attr(x, 'vcf').

References


EricEdwardBryant/mutagenesis documentation built on May 14, 2019, 6:13 p.m.