This function can download files using aspera ascp (recommended) or wget, by calling command-line interfaces using system2(). To download files in parallel, register a parallel backend using doFuture::registerDoFuture() or doParallel::registerDoParallel().

fetch(
  remoteFilepaths,
  outputDir = "fetch_output",
  overwrite = FALSE,
  wgetCmd = "wget",
  wgetArgs = "-q",
  ascpCmd = getAscpCmd(),
  ascpArgs = getAscpArgs(),
  ascpPrefix = "era-fasp"
)

Arguments

remoteFilepaths

Character vector of remote filepaths. For single-end reads, each element of the vector should be a single filepath. For paired-end reads, each element should be two filepaths separated by ";". If a remote filepath starts with "fasp", the file will be downloaded using ascp, otherwise the file will be downloaded using wget.

outputDir

String indicating the local directory in which to save the files. Will be created if it doesn't exist.

overwrite

Logical indicating whether to overwrite files that already exist in outputDir.

wgetCmd

String indicating command for fetching files using wget.

wgetArgs

Character vector indicating arguments to pass to wget.

ascpCmd

String indicating path to the ascp program.

ascpArgs

Character vector indicating arguments to pass to ascp.

ascpPrefix

String indicating prefix for downloading files by ascp, i.e., ascpPrefix@remoteFilepath.

Value

A list. As the function runs, it updates a tab-delimited log file in outputDir called "progress.tsv".

See also