Or shorter: ls *_1.fastq.gz | parallel --plus "bwa mem idx.fa {} {%_1.fastq.gz}_2.fastq.gz > {%_1.fastq.gz}.sam"
• 1 views
•
link
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.
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.
Or shorter: ls *_1.fastq.gz | parallel --plus "bwa mem idx.fa {} {%_1.fastq.gz}_2.fastq.gz > {%_1.fastq.gz}.sam"
Log in to answer this question.