Question: 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
gravatar for england_bioinformatics_team
2.3 years ago by

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.

bwa gnu shell parallel snap • 750 views
ADD COMMENTlink modified 2.3 years ago by ATpoint36k • written 2.3 years ago by england_bioinformatics_team20
1
gravatar for ATpoint
2.3 years ago by
ATpoint36k
Germany
ATpoint36k wrote:

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 COMMENTlink modified 2.3 years ago • written 2.3 years ago by ATpoint36k

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

ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by ole.tange3.8k
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: 1133 users visited in the last hour