Question: How to run a batch .sra to .fastq processing loop using linux bash?
1
gravatar for vassialk
5.0 years ago by
vassialk190
Belarus
vassialk190 wrote:

How to run a batch .sra to .fastq processing loop using linux bash and sratoolkit?

I am trying to run a script in  a bin folder of sra tools:

#!/bin/bash
        for i in `*.sra`;
        do
                ./fastq-dump
        done   

ADD COMMENTlink modified 5.0 years ago by dariober11k • written 5.0 years ago by vassialk190

I imagine you're missing the $I at the end of ./fastq-dump, but either way, this is best suited to stack overflow

ADD REPLYlink modified 11 months ago by RamRS30k • written 5.0 years ago by andrew.j.skelton736.0k

stackoverflow sends to Biostars!!!

ADD REPLYlink written 5.0 years ago by vassialk190
4
gravatar for Antonio R. Franco
5.0 years ago by
Spain. Universidad de Córdoba
Antonio R. Franco4.5k wrote:

It will be a lot better to use parallel since it can do the work using all of the cores available in your computer at once, saving time

sudo apt-get install parallel  #Will install parallel if necessary
find *sra | parallel 'fastq-dump --split-3 {}'

An alternative that uses a different directory, 6 cores and a regular (not a legacy) extraction of the sra files

cat ../extdata/sraFiles.txt | parallel -j 6 fastq-dump -I --split-files ../sra/{}.sra
ADD COMMENTlink modified 11 months ago by RamRS30k • written 5.0 years ago by Antonio R. Franco4.5k
1
gravatar for dariober
5.0 years ago by
dariober11k
WCIP | Glasgow | UK
dariober11k wrote:

You should remove backticks (`...`) for your code to work. If your have more than 1 processor available, you might want to run fastq-dump in parallel with xargs. For example, run up to 5 processes in parallel:

ls *.sra | xargs -I {} -P 5 -n 1 ./fastq-dump {}
ADD COMMENTlink modified 11 months ago by RamRS30k • written 5.0 years ago by dariober11k
0
gravatar for Chirag Nepal
5.0 years ago by
Chirag Nepal2.2k
Copenhagen
Chirag Nepal2.2k wrote:
for i in ls (*.sra)
do
    ./fastq-dump $i
done

Try this.

ADD COMMENTlink modified 11 months ago by RamRS30k • written 5.0 years ago by Chirag Nepal2.2k

Thank you, folks, how clever you are!!!

ADD REPLYlink written 4.9 years ago by elvissober20
1

So you are vassialk ? xD

ADD REPLYlink written 4.9 years ago by Michael Dondrup48k

New User..... From South Africa this time...

ADD REPLYlink modified 11 months ago by RamRS30k • written 4.9 years ago by andrew.j.skelton736.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1441 users visited in the last hour