This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Downloading multiple studies SRA data through while loop

Hi, I'm trying to download multiple studies through esearch by providing a .txt file with the SRP names in, but for some reason the loop terminates after the first study. I was wondering if anyone knows how I can resolve this?

while read study

do
        esearch -db sra -query ${study} | efetch --format runinfo | cut -d ',' -f 1 | grep SRR |
        xargs fastq-dump  --skip-technical \
        --readids --read-filter pass --dumpbase \
        --split-3 --outdir Output_folder/${study} --gzip
        echo "${study} fastq files generated"


done < project_datas.txt
e-utilities

Did you verify that esearch is bringing back valid results for all queries? For many accessions you may want to prefetch the data and then do dump.

0 answers

No answers yet.

Log in to answer this question.