Skip to contents

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

if (FALSE) { # \dontrun{
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)
} # }