Read a compressed bgz file into R.
Usage
read_bgz(
path,
method = c("data.table", "utils"),
nrows = NULL,
header = TRUE,
verbose = TRUE,
...
)Arguments
- path
Path to bgz-compressed file.
- method
Method to use to import bgz file.
- nrows
The maximum number of rows to read. Unlike
read.table, you do not need to set this to an estimate of the number of rows in the file for better speed because that is already automatically determined byfreadalmost instantly using the large sample of lines.nrows=0returns the column names and typed empty columns determined by the large sample; useful for a dry run of a large file or to quickly check format consistency of a set of files before starting to read any of them.- header
Does the first data line contain column names? Defaults according to whether every non-empty field on the first data line is type character. If so, or TRUE is supplied, any empty column names are given a default name.
- verbose
Be chatty and report timings?
- ...
Additional arguments passed to fread or read.delim2.
Details
NOTE: Packages like Rsamtools and seqminer aren't great for this because they require that the bgz file it also indexed already.
See also
Other tabix functions:
construct_tabix_path(),
construct_vcf_path(),
convert(),
index,
query_table(),
query_vcf(),
run_bgzip()