I want to download all SRA file from the following project. Is there a method to download all the SRA files at the same time?
-
You could use the R/Bioconductor package SRAdb – John Blischak Oct 16 '17 at 21:06
-
1@JohnBlischak This might be an answer if expanded explaining how SRAdb helps to answer the question – llrs Oct 17 '17 at 10:50
7 Answers
A quick look at your link tells me the SRR numbers run from SRR837819 to SRR837856. You can use fastq-dump from the sratoolkit, and make a for loop around it in bash.
Something like this should work:
for (( i = 19; i <= 56; i++ ))
do
fastq-dump --accession SRR8378$i
done
After reading Devon Ryan's answer, I realize that you asked for SRA files instead of fastq. This can also be done with prefetch of the sratoolkit:
for (( i = 19; i <= 56; i++ ))
do
prefetch SRR8378$i
done
- 3,571
- 9
- 28
Assuming you ultimately just want the fastq files and you know the SRR (run) numbers, I would download them from here: ftp://ftp.sra.ebi.ac.uk/vol1/fastq/
As for downloading multiple files, I've just used multiple wget commands. I don't know of a way to download all of the files together in like a zipped folder or anything :/
- 51
- 3
I suggest you follow the advice in Eric A Brenner's answer and just download the fastq files. However, if you really really want to use the SRA files for some reason, note that you can use parallel-fastq-dump to make things faster. Do follow its advice regarding using prefetch.
You'd need to combine that with the answer from b.nota (i.e., put the commands in a for loop).
- 19,602
- 2
- 29
- 60
I was able to find a solution for this using Entrez Direct and SRA toolkit :) If you have the project number or SRA project number, yours would be SRP022054 in this case for the 36 SRAs, you can use esearch to make a query like so and pipe it into SRA toolkit with this one liner:
esearch -db sra -query SRP022054 | efetch --format runinfo | cut -d ',' -f 1 | grep SRR | head -5 | xargs fastq-dump --skip-technical --readids --read-filter pass --dumpbase --split-3
- 11
- 1
You can download an entire project using pysradb:
pysradb download -p SRP022054
It retains the same schema as SRA.
- 991
- 8
- 17
Once you install SRA tools, you can grab a BioProject/SRP accession list (Send to - File - Accession List) and save it to default SRA tools /sra directory, then run (with /sra as cwd):
prefetch --option-file SraAccList.txt
cat SraAccList.txt | xargs fasterq-dump --outdir "/your-directory/for-fastq"
P.S. The text file can be any list of accessions, separated by return. Tested in Bash
- 1
- 1
This online tool creates download links for the less tech savy:
Using PRJNA201245 as ID, it provides several codes including a bash script for downloading all files.
- 3
- 1