skip to main content

SRA Toolkit Documentation

Back to List of the Tools

Tool: prefetch

Usage:
prefetch [options] <path/SRA file | path/kart file> [<path/file> ...]
prefetch [options] <SRA accession>
prefetch [options] --list <kart_file>
Frequently Used Options:
General:
-h | --help Displays ALL options, general usage, and version information.
-V | --version Display the version of the program.
Data transfer:
-f | --force <value> Force object download. One of: no, yes, all. no [default]: Skip download if the object if found and complete; yes: Download it even if it is found and is complete; all: Ignore lock files (stale locks or if it is currently being downloaded: use at your own risk!).
--transport <value> Value one of: ascp (only), http (only), both (first try ascp, fallback to http). Default: both.
-l | --list List the contents of a kart file.
-s | --list-sizes List the content of kart file with target file sizes.
-N | --min-size <size> Minimum file size to download in KB (inclusive).
-X | --max-size <size> Maximum file size to download in KB (exclusive). Default: 20G.
-o | --order <value> Kart prefetch order. One of: kart (in kart order), size (by file size: smallest first). default: size.
-a | --ascp-path <ascp-binary|private-key-file> Path to ascp program and private key file (asperaweb_id_dsa.openssh).
-p | --progress <value> Time period in minutes to display download progress (0: no progress). Default: 1.
--option-file <file> Read more options and parameters from the file.
Use examples:
prefetch cart_0.krt
Download the files listed in the kart file.
prefetch -l cart_0.krt
Lists the contents of the kart file.
prefetch -X 200G cart_0.krt
Sets the maximum download file size to 200GB and downloads the files listed in the kart.
prefetch -o kart cart_0.krt
Downloads the contents in the order listed in the kart. Preferred for large run sets (example: 100+) where calculating the download sizes may cause a delay to the start of downloads.
prefetch -a "/opt/aspera/bin/ascp|/opt/aspera/etc/asperaweb_id_dsa.openssh" SRR390728
When the toolkit is unable to locate an installed version of Aspera, the location of ascp and ssh key (-a /opt/aspera/bin/ascp|/opt/aspera/bin/asperaweb_id_dsa.openssh") can be provided.
prefetch -t ascp -a "/opt/aspera/bin/ascp|/opt/aspera/bin/asperaweb_id_dsa.openssh" --option-file file.txt
Will force download to be only through aspera (-t ascp) and will prevent http download, default operation is to attempt ascp first and use http if Aspera is not found or fails. Will sequentially download the SRA data files and references required for a list of accessions in "file.txt". The format for "file.txt" is a newline-separated list of accessions: SRR# SRR# SRR# …
prefetch ~/Downloads/SRR390728.sra
If you have already downloaded an SRA datafile (example here: SRR390728.sra, present in the "~/Downloads" directory), this command will retrieve all of the reference sequences required to extract the data. This command is useful for resolving errors of the type "name not found while resolving tree" - meaning that a reference(s) is required, but cannot be located.
prefetch -c SRR390728
This command will check the availability of all needed reference sequences (-c) for a given accession.
Possible errors and their solution:
path not found while resolving tree within virtual file system module '<path>/SRR*.sra' cannot be found."
Check to make sure the file and path you have specified exist on your system, also check the path name for typos.
param invalid while parsing argument list - ascp-path expected in the following format: --ascp-path "<ascp-binary|private-key-file>"
Check to make sure that the paths to "ascp" (ascp.exe in a Windows environment) and "asperaweb_id_dsa.openssh" are correct and are separated by a pipe "|" character as in the example.
path not found while resolving tree within virtual file system module - 'SRR*' cannot be found.
This error indicates that prefetch is unable to locate the requested file. Check that you have entered a valid accession.
file not found while opening manager within virtual file system module - VFSManagerOpenFileRead() failed
This error indicates that prefetch cannot locate your option-file, check that the file exists and that the path to it is correct.