Is there a way to download FASTq files from SRR IDs?
1
0
Entering edit mode
7.4 years ago
Paul ▴ 80

I have a bunch of SRR IDs and need to download Fastq files for the same.

I tried downloading SRAtoolkit for the same by doing

apt-get install sra-toolkit
export PATH=$PATH:$PWD/sratoolkit.2.8.2-1-ubuntu64/bin
which fastq-dump
/User/sratoolkit.2.8.2-1-ubuntu64/bin/fastq-dump
fastq-dump --stdout SRR390728 | head -n 8

Shows an error like

 fastq-dump.2.8.2 sys: connection failed while opening file within cryptographic module - mbedtls_ssl_handshake returned -29184 ( SSL - An invalid SSL record was received )
 fastq-dump.2.8.2 err: item not found while constructing within virtual database module - the path 'SRR390728' cannot be opened as database or table

What should I do? Is there any other way to download read files rather than using fastq-dump?

Since I have multiple SRR IDs, is there any other method I can download all the Fastq files in a go?

eutility fastq sra • 13k views
ADD COMMENT
5
Entering edit mode

Save yourself the trouble and get the fastq's from EBI-ENA.

ADD REPLY
0
Entering edit mode

In case it is not mirrored there, use the prefetch tool to download SRAs via Aspera (100Mb/s) and then run fastq-dump on that file. Fastq-dump as a download tool is unusably slow, error prone and a hugh PITA ( like the entire SRA format ).

ADD REPLY
1
Entering edit mode

are you working behind a proxy ?

ADD REPLY
1
Entering edit mode

You are installing sra-toolkit system-wide with apt, but are using a downloaded binary. I guess your system is missing some shared library, or with an incompatible version. What is your OS, which version? Try using your system-installed fastq-dump:

/usr/bin/fastq-dump --stdout SRR390728 | head -n 8

I just tested my apt-get installed fastq-dump and it works:

$ fastq-dump  --version

fastq-dump : 2.8.1

$ which fastq-dump 
/usr/bin/fastq-dump

$ fastq-dump --stdout SRR390728 | head -n 8
@SRR390728.1 1 length=72
CATTCTTCACGTAGTTCTCGAGCCTTGGTTTTCAGCGATGGAGAATGACTTTGACAAGCTGAGAGAAGNTNC
+SRR390728.1 1 length=72
;;;;;;;;;;;;;;;;;;;;;;;;;;;9;;665142;;;;;;;;;;;;;;;;;;;;;;;;;;;;;96&&&&(
@SRR390728.2 2 length=72
AAGTAGGTCTCGTCTGTGTTTTCTACGAGCTTGTGTTCCAGCTGACCCACTCCCTGGGTGGGGGGACTGGGT
+SRR390728.2 2 length=72
;;;;;;;;;;;;;;;;;4;;;;3;393.1+4&&5&&;;;;;;;;;;;;;;;;;;;;;<9;<;;;;;464262
ADD REPLY
1
Entering edit mode
3.5 years ago
Sukjun Kim ▴ 90

Why don't you try this one? It will automatically download all FASTQ files if you have multiple SRR IDs

#!/bin/bash

sra_ids="SRR390727 SRR390728 SRR390729 SRR390730"

for sra_id in ${sra_ids}; do
    fastq-dump ${sra_id}
done

Or it can also download all FASTQ files which belongs to the SRX accession.

#!/bin/bash

srx_id=SRX079566

sra_ids=$(wget -qO- "http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?save=efetch&db=sra&rettype=runinfo&term=${srx_id}" | grep ${srx_id} | cut -f1 -d",")

for sra_id in "${sra_ids[@]}"; do
    fastq-dump ${sra_id}
done
ADD COMMENT
2
Entering edit mode

For the sake of reference, I am not sure the speed of fastq-dump. I think, I saw people saying it is slower than using aspera on the post below.

Check this out: [Deprecated] Fast download of FASTQ files from the European Nucleotide Archive (ENA)

I do realize it says it is Deprecated, but I use Step 1 and Step 2, used recently, and the download was pretty fast.

If you do Step 1 (installing aspera - fast downloading) and Step 2 (use https://sra-explorer.info/ to create aspera download links that you just run through your terminal) on that tutorial.

ADD REPLY
1
Entering edit mode

Yes, I think so. If you can use aspera, it would be great option rather than fastq-dump.

ADD REPLY

Login before adding your answer.

Traffic: 2031 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6