This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Download entire SRA study to convert to Fastq

There is an NCBI SRA project I would like to convert to Fastq files. I know I can use use SRA tools and convert individual files but how do I download all of the files as Fastq files at once (there are 174 of them so I don't want to do it manually).

rna-seq sra fastq

3 answers

Peit's comment is great. Just added a little bit more for a thorough solution.

Suppose the study ID is "PRJNA223640"

We can get URLs of all SRA files and then used as input for wget

wget 'http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?save=efetch&rettype=runinfo&db=sra&term=PRJNA223640' -O - | cut -d',' -f12 |  xargs -n 1 wget
-----------------------------------------------------------------------------------------------^^^^^^^^^^^

Great answer, copied for own use -

I'd add a grep -v '^Run' after the wget command to get rid of the table's header since that one causes a small error in the second wget command

Thanks so much guys! I also wanted to add that I found out about this entrez direct tool as well and was able to successfully download all the files and covert to fastqs with that using:

esearch -db sra -query PRJNA291386 | efetch --format runinfo | cut -d ',' -f 1 | grep SRR | xargs fastq-dump

you may want to add --split-3 to the fastq-dump command it'll split up your paired reads file into two files ending in _1 and _2, based on personal preference. If you don't have paired read files then you can ignore that flag.

This is also a nice method: https://nf-co.re/fetchngs/usage

Log in to answer this question.