Al-Murphy / MungeSumstats

Rapid standardisation and quality control of GWAS or QTL summary statistics
https://doi.org/doi:10.18129/B9.bioc.MungeSumstats
75 stars 16 forks source link

Handle reading .bgz files #64

Closed bschilder closed 3 years ago

bschilder commented 3 years ago

data.table::fread can't handle .bgz files by default. This means all functions that rely on it (read_sumstats, read_header) fail for many tabix-indexed files.

Made changes throughout the code to detect and import bgz files with the following trick:

path <- "filepath.tsv.bgz"
dat <- data.table::fread(cmd=paste("gunzip -c",path))

My only concern is that gunzip might not be installed on every machine, though I think gzip (which its part of) comes standard with most OS.