Description Usage Arguments Details Value See Also Examples
View source: R/sratoolkit_functions.R
'prefetch()' uses the SRAtoolkit command-line function 'prefetch' to download .sra
files from all samples returned by a queryMetadata
query of GEOME, when one of the
entities queried was 'fastqMetadata'
1 2 |
queryMetadata_object |
A list object returned from 'queryMetadata' where one of the entities queried was 'fastqMetadata'. |
sratoolkitPath |
String. A path to a local copy of sratoolkit. Only necessary if sratoolkit is not on your $PATH. Assumes executables are inside 'bin'. |
outputDirectory |
String. A path to the directory where you would like the files to be stored. |
arguments |
A string variable of arguments to be passed directly to 'prefetch'. Defaults to "-p 1" to show progress. Use prefetchHelp = TRUE to see a list of arguments. |
prefetchHelp |
Logical. prefetchHelp = T will show the help page for 'prefetch' and then quit. |
This function works best with SRAtoolkit functions of version 2.9.6 or greater. SRAtoolkit functions can (ideally) be in your $PATH, or you can supply a path to them using the sratoolkitPath argument.
It downloads files to the current working directory unless a different one is assigned through outputDirectory.
'prefetch' will automatically use the Fast and Secure Protocol (FASP) in the Aspera Connect package if the 'ascp' executable is in your $PATH. Otherwise it will use HTTPS.
You can alternatively pass the path to 'ascp' by using arguments="-a path/to/ascp"
This function will not return anything within r. It simply downloads .sra files. It will print command line stdout to the console, and also provide a start and end time and amount of time elapsed during the download.
https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=toolkit_doc to download pre-compiled executables for sratoolkit or https://github.com/ncbi/sra-tools/wiki/Building-and-Installing-from-Source> to install from source
Use 'prefetch' in combination with fastqDump
or fasterqDump
to convert .sra files to .fastq.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# Run a query of GEOME first
acaoli <- queryMetadata(
entity = "fastqMetadata",
query = "genus = Acanthurus AND specificEpithet = olivaceus AND _exists_:bioSample",
select=c("Event"))
#trim to 3 entries for expediency
acaoli$fastqMetadata<-acaoli$fastqMetadata[1:3,]
acaoli$Event<-acaoli$Event[1:3,]
prefetch(queryMetadata_object = acaoli)
fastqDump(queryMetadata_object = acaoli, filenames = "IDs", source = "local", cleanup = T)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.