5
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ You could use the R/Bioconductor package SRAdb $\endgroup$ Oct 16, 2017 at 21:06
  • 1
    $\begingroup$ @JohnBlischak This might be an answer if expanded explaining how SRAdb helps to answer the question $\endgroup$
    – llrs
    Oct 17, 2017 at 10:50

7 Answers 7

4
$\begingroup$

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
$\endgroup$
3
$\begingroup$

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

$\endgroup$
3
$\begingroup$

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

$\endgroup$
1
$\begingroup$

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

$\endgroup$
0
$\begingroup$

You can download an entire project using pysradb:

pysradb download -p SRP022054

It retains the same schema as SRA.

$\endgroup$
0
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.