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
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
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
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 {}
for i in ls (*.sra)
do
./fastq-dump $i
done
Try this.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I imagine you're missing the
$I
at the end of./fastq-dump
, but either way, this is best suited to stack overflowstackoverflow sends to Biostars!!!