vcf_is_empty | R Documentation |
Checks if the VCF file contains any variants.
vcf_is_empty(x)
x |
Path to VCF file. |
TRUE if there is at least one variant in the VCF, FALSE otherwise.
x <- system.file("extdata/umccrise/snv/somatic-ensemble-PASS.vcf.gz", package = "gpgr")
(y <- vcf_is_empty(x))
tmp1 <- tempfile(pattern = "fakeFile", fileext = "vcf")
writeLines(c("col1\tcol2\tcol3", "1\t2\t3"), con = tmp1)
## Not run:
vcf_is_empty(tmp1)
## End(Not run)
vcf_cols <- c(
"#CHROM", "POS", "ID", "REF", "ALT", "QUAL",
"FILTER", "INFO", "FORMAT"
)
tmp2 <- tempfile(pattern = "fakeFile", fileext = "vcf")
writeLines(paste(vcf_cols, collapse = "\t"), con = tmp2)
(z <- vcf_is_empty(tmp2))
tmp3 <- tempfile(pattern = "fakeFile", fileext = "FOO")
writeLines(paste(vcf_cols, collapse = "\t"), con = tmp3)
## Not run:
vcf_is_empty(tmp3)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.