is_vcf: Does the input file look like a VCF?

View source: R/utils.R

is_vcfR Documentation

Does the input file look like a VCF?

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

is_vcf(x)

Arguments

x

Path to file.

Value

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

Examples

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 April 21, 2024, 1:16 a.m.