Download a remote VCF file and its index file

download_vcf(
  vcf_url,
  vcf_dir = tempdir(),
  download_method = "download.file",
  force_new = FALSE,
  quiet = TRUE,
  nThread = parallel::detectCores() - 1
)

Arguments

vcf_url

Remote URL to VCF file.

vcf_dir

Where to download VCF file.

download_method
  • "axel" : Multi-threaded

  • "wget" : Single-threaded

  • "download.file" : Single-threaded

  • "internal" : Single-threaded (passed to download.file)

  • "wininet" : Single-threaded (passed to download.file)

  • "libcurl" : Single-threaded (passed to download.file)

  • "curl" : Single-threaded (passed to download.file)

or "download.file" (single-threaded) .

force_new

Overwrite a previously downloaded VCF with the same path name.

quiet

Run quietly.

nThread

Number of threads to parallelize over.

Value

List containing the paths to the downloaded VCF and its index file.

Examples

vcf_url <- "https://gwas.mrcieu.ac.uk/files/ieu-a-298/ieu-a-298.vcf.gz" out_paths <- download_vcf(vcf_url = vcf_url)
#> Downloading VCF ==> /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//RtmpVKp4EN/ieu-a-298.vcf.gz
#> Downloading with download.file.
#> Time difference of 0.2723339 secs
#> Downloading VCF index ==> https://gwas.mrcieu.ac.uk/files/ieu-a-298/ieu-a-298.vcf.gz.tbi
#> Downloading with download.file.
#> Time difference of 0.2062631 secs