Are there any GNU parallel or similar Shell/Bash code examples on how to run Snap and BWA aligners on a batch of paired .fastq files?
1
1
Entering edit mode
6.6 years ago

Are there any GNU parallel or similar Shell/Bash code examples on how to run Snap and BWA aligners on a batch of paired .fastq files? We have almost a 1000 of them. Thx.

gnu parallel shell snap bwa • 1.8k views
ADD COMMENT
4
Entering edit mode
6.6 years ago
ATpoint 85k

Yes, plenty but you should give some more details what you need. Given that your files end with _1.fastq.gz and _2.fastq.gz, you can do:

ls *_1.fastq.gz | awk -F "_1.fastq.gz" '{print $1}' | parallel "bwa mem idx.fa {}_1.fastq.gz {}_2.fastq.gz > out.sam"

Passing the -j parameter to parallel will allow to specifiy how many files are to be processed in parallel.

ADD COMMENT
0
Entering edit mode

Or shorter: ls *_1.fastq.gz | parallel --plus "bwa mem idx.fa {} {%_1.fastq.gz}_2.fastq.gz > {%_1.fastq.gz}.sam"

ADD REPLY

Login before adding your answer.

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