download.SRA: Download read libraries from SRA

Description Usage Arguments Value References See Also Examples

View source: R/SRA_helper.R

Description

Multicore version download, see documentation for SRA toolkit for more information.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
download.SRA(
  info,
  outdir,
  rename = TRUE,
  fastq.dump.path = install.sratoolkit(),
  settings = paste("--skip-technical", "--split-files"),
  subset = NULL,
  compress = TRUE,
  BPPARAM = bpparam()
)

Arguments

info

character vector of only SRR numbers or a data.frame with SRA metadata information including the SRR numbers in a column called "Run" or "SRR". Can be SRR, ERR or DRR numbers. If only SRR numbers can not rename, since no additional information is given.

outdir

a string, default: cbu server

rename

logical or character, default TRUE (Auto guess new names). False: Skip renaming. A character vector of equal size as files wanted can also be given. Priority of renaming from the metadata is to check for unique names in the LibraryName column, then the sample_title column if no valid names in LibraryName. If new names found and still duplicates, will add "_rep1", "_rep2" to make them unique. If no valid names, will not rename, that is keep the SRR numbers, you then can manually rename files to something more meaningful.

fastq.dump.path

path to fastq-dump binary, default: path returned from install.sratoolkit()

settings

a string of arguments for fastq-dump, default: paste("–gzip", "–skip-technical", "–split-files")

subset

an integer or NULL, default NULL (no subset). If defined as a integer will download only the first n reads specified by subset. If subset is defined, will force to use fastq-dump which is slower than ebi download.

compress

logical, default TRUE. Download compressed files ".gz".

BPPARAM

how many cores/threads to use? default: bpparam(). To see number of threads used, do bpparam()$workers

Value

a character vector of download files filepaths

References

https://ncbi.github.io/sra-tools/fastq-dump.html

See Also

Other sra: download.SRA.metadata(), download.ebi(), install.sratoolkit(), rename.SRA.files()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SRR <- c("SRR453566") # Can be more than one

## Simple single SRR run of YEAST
outdir <- tempdir() # Specify output directory
# Download, get 5 first reads
#download.SRA(SRR, outdir, subset = 5)

## Using metadata column to get SRR numbers and to be able to rename samples
outdir <- tempdir() # Specify output directory
info <- download.SRA.metadata("SRP226389", outdir) # By study id
# Download, 5 first reads of each library and rename
#download.SRA(info, outdir, subset = 5)

ORFik documentation built on March 27, 2021, 6 p.m.