6

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?

llrs
  • 4,693
  • 1
  • 18
  • 42
user2300940
  • 223
  • 1
  • 2
  • 5

7 Answers7

4

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
benn
  • 3,571
  • 9
  • 28
3

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 :/

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).

Devon Ryan
  • 19,602
  • 2
  • 29
  • 60
1

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

Kai Fung
  • 11
  • 1
0

You can download an entire project using pysradb:

pysradb download -p SRP022054

It retains the same schema as SRA.

rightskewed
  • 991
  • 8
  • 17
0

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

0

This online tool creates download links for the less tech savy:

https://sra-explorer.info/#

Using PRJNA201245 as ID, it provides several codes including a bash script for downloading all files.