Internal helpers used by read_vcf() to work with VCF files that
are suitable for parallel reading with SeqArray, i.e. bgzip-
compressed and Tabix-indexed.
detect_indexing() checks whether a VCF file:
is bgzip-compressed (
.vcf.gz);has an existing Tabix index (
.tbior.csi);and that the index can be opened without error.
indexing_vcf() ensures that a VCF file is bgzip-compressed and
indexed with Tabix. If the file is not .vcf.gz, it is compressed
with Rsamtools::bgzip(); if no index is found, it is created via
Rsamtools::indexTabix().
The typical workflow is to first call detect_indexing() and, if it
returns TRUE, to run indexing_vcf() to make the VCF
compatible with parallel chunked reading.
Value
detect_indexing(): (logical)TRUEif the VCF needs compression and/or indexing (i.e. is not ready for parallel reading),FALSEif it is already bgzipped and indexed with a readable Tabix index.indexing_vcf(): (character) The path to the bgzipped and Tabix-indexed VCF.
