Ideally, we would use gwasvcf instead but it hasn't been made available on CRAN or Bioconductor yet, so we can't include it as a dep.
download_vcf(
vcf_url,
vcf_dir = tempdir(),
vcf_download = TRUE,
download_method = "download.file",
force_new = FALSE,
quiet = FALSE,
timeout = 10 * 60,
nThread = 1
)
Remote URL to VCF file.
Where to download the original VCF from Open GWAS.
WARNING: This is set to tempdir()
by default.
This means the raw (pre-formatted) VCFs be deleted upon ending the R session.
Change this to keep the raw VCF file on disk
(e.g. vcf_dir="./raw_vcf"
).
Download the original VCF from Open GWAS.
"axel"
(multi-threaded) or
"download.file"
(single-threaded) .
Overwrite a previously downloaded VCF with the same path name.
Run quietly.
How many seconds before giving up on download.
Passed to download.file
. Default: 10*60
(10min).
Number of threads to parallelize over.
List containing the paths to the downloaded VCF and its index file.
#only run the examples if user has internet access:
if(try(is.character(getURL("www.google.com")))==TRUE){
vcf_url <- "https://gwas.mrcieu.ac.uk/files/ieu-a-298/ieu-a-298.vcf.gz"
out_paths <- download_vcf(vcf_url = vcf_url)
}
#> Error in getURL("www.google.com") : could not find function "getURL"