is_vcf: Does the input file look like a VCF?

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Quickly checks that the input file has a 'vcf' or 'vcf.gz' suffix, and that the column names correspond to typical VCF column headers.

Usage

1
is_vcf(x)

Arguments

x

Path to file.

Value

TRUE if the input file is inferred to be a VCF, FALSE otherwise.

Examples

1
2
3
4
5
x <- system.file("extdata/umccrise/snv/somatic-ensemble-PASS.vcf.gz", package = "gpgr")
(y <- is_vcf(x))
tmp_file <- tempfile(pattern = "fakeFile", fileext = "vcf")
writeLines(c("col1\tcol2\tcol3", "1\t2\t3"), con = tmp_file)
(z <- is_vcf(tmp_file))

umccr/gpgr documentation built on Nov. 25, 2021, 1:15 p.m.