2
$\begingroup$

I want to zip the files generated by fasterq-dump simultaneously as they are generated. The code that I tried is this.

cat SRR_Acc_List.txt | while read i 
do  fasterq-dump ${i} --split-spot -v --skip-technical  -e 15| gzip -k  ${i}> ${i}.gz 
done
$\endgroup$
0

2 Answers 2

1
$\begingroup$

Haven't tried, but I believe you may add -Z to fasterq-dump and remove -k ${i} from gzip. In addition, I would recommend the following:

cat SRR_Acc_List.txt | xargs -i echo fasterq-dump {} --split-spot -Z -v --skip-technical -e 15 \| gzip > {}.gz | sh

It is simpler and more flexible. For example, replacing sh with parallel would allow you to download in parallel.

$\endgroup$
0
1
$\begingroup$

I tried this and it worked

cat SRR_Acc_List.txt | while read i ; do  fasterq-dump ${i} --split-spot -v --skip-technical  -e 20 ; for j in i ; do   gzip ${i}.fastq  ; done; done
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.