vcf_to_dt: Variant Call Format (VCF) -> data.table

View source: R/vcf_to_dt.R

vcf_to_dtR Documentation

Variant Call Format (VCF) –> data.table

Description

Function to convert a VCF object to a data.table.

Usage

vcf_to_dt(
  vcf,
  add_sample_names = TRUE,
  add_rowranges = TRUE,
  standardise_colnames = TRUE,
  verbose = TRUE
)

Arguments

vcf

Variant Call Format (VCF) file imported into R as a VariantAnnotation CollapsedVCF/ ExpandedVCF object.

add_sample_names

Append sample names to column names (e.g. "EZ" –> "EZ_ubm-a-2929").

add_rowranges

Include rowRanges from VCF as well.

standardise_colnames

Automatically rename all columns to a standard nomenclature using standardise_header.

verbose

Print messages.

Value

data.frame version of VCF

Examples

vcf_file <- system.file("extdata", "BST1.1KGphase3.vcf.bgz",
                        package = "echodata")
vcf <- VariantAnnotation::readVcf(file = vcf_file)
vcf_dt <- echotabix::vcf_to_dt(vcf = vcf)

RajLabMSSM/echotabix documentation built on Nov. 21, 2023, 8:02 a.m.