Download SRA.
Usage
DownloadSRA(
gsm.df,
out.folder = NULL,
download.method = c("prefetch", "download.file", "ascp"),
prefetch.path = NULL,
prefetch.paras = "-X 100G",
quiet = FALSE,
timeout = 3600,
ascp.path = NULL,
max.rate = "300m",
rename = TRUE,
parallel = TRUE,
use.cores = NULL
)
Arguments
- gsm.df
Dataframe contains GSM and Run numbers, obtained from
ExtractRun
.- out.folder
Output folder. Default: NULL (current working directory).
- download.method
Method to download sra files, chosen from "prefetch", "download.file", "ascp". Default: "prefetch".
- prefetch.path
Path to prefetch. Used when
ExtractRun
is "prefetch". Default: NULL (conduct automatic detection).- prefetch.paras
Parameters for
prefetch
. Used whenExtractRun
is "prefetch". Default: "-X 100G".- quiet
Logical value, whether to show downloading progress. Used when
download.method
is "download.file". Default: FALSE (show).- timeout
Maximum request time. Used when
download.method
is "download.file". Default: 3600.- ascp.path
Path to ascp (/path/bin/ascp), please ensure that the relative path of asperaweb_id_dsa.openssh file (/path/bin/ascp/../etc/asperaweb_id_dsa.openssh). Default: NULL (conduct automatic detection).
- max.rate
Max transfer rate. Used when
download.method
is "ascp". Default: 300m.- rename
Logical value, whether to rename the download sra files. Recommended when
download.method
is "ascp". Default: FALSE (show).- parallel
Logical value, whether to download parallelly. Used when
download.method
is "ascp" or "download.file". Default: TRUE.- use.cores
The number of cores used. Used when
download.method
is "ascp" or "download.file". Default: NULL (the minimum value ofnrow(gsm.df)
andparallel::detectCores()
).
Examples
if (FALSE) {
# need users to provide the prefetch.path and out.folder
GSE186003.runs <- ExtractRun(acce = "GSE186003", platform = "GPL24247")
# prefetch
GSE186003.down <- DownloadSRA(
gsm.df = GSE186003.runs, prefetch.path = "/path/to/prefetch",
out.folder = "/path/to/output"
)
# download.file
GSE186003.down <- DownloadSRA(
gsm.df = GSE186003.runs, download.method = "download.file",
timeout = 3600, out.folder = "/path/to/output",
parallel = TRUE, use.cores = 2
)
# ascp
GSE186003.down <- DownloadSRA(
gsm.df = GSE186003.runs, download.method = "ascp",
ascp.path = "/path/to/ascp", max.rate = "300m",
rename = TRUE, out.folder = "/path/to/output",
parallel = TRUE, use.cores = 2
)
}