Biostar Beta. Not for public use.
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
Entering edit mode

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.

ADD COMMENTlink 22 months ago england_bioinformatics_team • 20 • updated 22 months ago ATpoint 17k
1
Entering edit mode

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 22 months ago ATpoint 17k
Entering edit mode
0

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

ADD REPLYlink 22 months ago
ole.tange
♦ 3.4k

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.0