issue regarding download SRA file in bulk
1
0
Entering edit mode
16 months ago

I want to download a bulk amount of SRA files with sra-toolkit with a bash scripting code but it is not working can it be fixed?

#!/bin/sh
input="/home/omic/Downloads/peanut16s/input.txt"
while IFS= read -r line
do
    echo "fasterq-dump --split-3 $line -O FASTQ_files/"
done

content of input is like the following-

SRR5790113 SRR5790112 SRR5790110 SRR5790105
SRR5790102 SRR10993629 SRR10993630 SRR10993631 SRR8324681 SRR7053176

sra-toolkit ncbi-sra coding • 1.1k views
ADD COMMENT
0
Entering edit mode

What is not working?

input=file_input

while read -r line; do echo "fasterq-dump --split-files $line FASTQ_f"; done < $input
fasterq-dump --split-files SRR5790113 FASTQ_f
fasterq-dump --split-files SRR5790112 FASTQ_f
fasterq-dump --split-files SRR5790110 FASTQ_f
ADD REPLY
0
Entering edit mode

Thank you so much for your response GenoMax sir, I was up to you but I can't see my jobs being done eg. No sra file being downloaded.

ADD REPLY
0
Entering edit mode
16 months ago
GenoMax 147k

I hope you remembered to remove echo from your command in loop. Commands won't execute until you do that.

I am not sure why you are using --split-3. First two SRA accessions I checked are single end data. I was able to download a couple of reads for each. So the issue is on your end.

ADD COMMENT
0
Entering edit mode

Yeah, Thank you so much GenoMax sir, I was using this script for paired-end SRA file download that's why I use --split-3. My code was not running because I put echo after do and my command into a double inverted comma. Now my code is running perfectly fine. Thank you so much sir for rectifying me. my corrected code is the following.

#!/bin/bash

input="/home/omics/Downloads/peanut16s/input.txt"
while read -r line; do fasterq-dump --split-files $line -O FASTQ_files; done < $input
ADD REPLY
0
Entering edit mode

I have an additional question regarding this same topic, please tell me how can I check the integrity of the downloaded SRA file?

ADD REPLY
1
Entering edit mode

You are not downloading SRA files by this method. You are getting fastq files.

If you want to validate the data then you should consider getting .sra format files using prefetch. Then use vdb-validate to validate the SRA files before extracting fastq data.

ADD REPLY

Login before adding your answer.

Traffic: 1673 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