Download sequencing data from the SRA
Fetch public sequencing reads from the NCBI SRA by accession with prefetch and fasterq-dump, then split mates and compress to gzipped FASTQ.
Prerequisites
- SRA Toolkit installed and configured once with `vdb-config`
- A valid SRA run accession (SRR / ERR / DRR)
- Enough free disk space for the .sra archive plus the extracted FASTQ
1Prefetch the .sra archive
Download the run archive first. prefetch pulls the full .sra over HTTPS, is resumable, and leaves the file in ./SRR000001/ so the conversion step never has to hit the network.
prefetch SRR000001Expected output
2026-07-21T09:12:04 prefetch.3.1.1: Current preference is set to retrieve SRA Normalized Format files with full base quality scores.
2026-07-21T09:12:05 prefetch.3.1.1: 1) Downloading 'SRR000001'...
2026-07-21T09:12:05 prefetch.3.1.1: Downloading via HTTPS...
2026-07-21T09:13:41 prefetch.3.1.1: HTTPS download succeeded
2026-07-21T09:13:41 prefetch.3.1.1: 1) 'SRR000001' was downloaded successfully
2026-07-21T09:13:41 prefetch.3.1.1: 'SRR000001' has 0 unresolved dependencies2Convert to FASTQ and split the mates
Extract reads from the local archive. --split-files writes each mate to its own file, -e 8 uses 8 threads, and -O sends the output to fastq/. For paired data you get fastq/SRR000001_1.fastq and fastq/SRR000001_2.fastq.
fasterq-dump SRR000001 --split-files -e 8 -O fastq/Expected output
join :|-------------------------------------------------- 100.00%
concat :|-------------------------------------------------- 100.00%
spots read : 12,345,678
reads read : 24,691,356
reads written : 24,691,3563Compress the FASTQ files
fasterq-dump writes plain-text FASTQ, so gzip it to save disk and match what downstream tools expect. gzip runs silently and replaces each file in place; list the folder to confirm the compressed mates.
gzip fastq/SRR000001_*.fastqExpected output
$ ls -lh fastq/
total 2.8G
-rw-r--r-- 1 user staff 1.4G Jul 21 09:20 SRR000001_1.fastq.gz
-rw-r--r-- 1 user staff 1.4G Jul 21 09:20 SRR000001_2.fastq.gzTroubleshooting
fasterq-dump is very slow or keeps re-downloading the run
Run `prefetch SRR000001` first. Without a local .sra archive, fasterq-dump streams the run from NCBI on every call; once the archive is in ./SRR000001/ it works from disk.
Only one FASTQ file appears for a run you know is paired-end
Add `--split-files` so each mate goes to its own file, or use `--split-3` to also capture unpaired/orphan reads in a separate SRR000001.fastq.
prefetch fails with 'path not found while resolving tree within virtual file system module'
The accession is invalid or not yet public. Re-check the SRR/ERR/DRR ID on the SRA Run Selector and confirm the run has released data.