I have a set of 2 compressed paired files like:
and I want to run
bwa mem with multiple threads on it. As the files are compress in
.bzip2 I am using a shell script to pipe two commands for compressing both into
bwa mem at once. The code is as follows:
bwa mem -t20 /projects/ref.fa \ <(pbzip2 -kdc -m5000 -p12 /projects/L1_R1.fastq.bz2) \ <(pbzip2 -kdc -m5000 -p12 /projects/L1_R2.fastq.bz2) \ | samtools view -u -F4 | samtools sort -@8 -o /projects/linearL1.bam
I am using pbzip2 which do the decompression using multiple cores (
-p12). Additionally, I set the
-t20 parameter for
bwa mem. But when I run the script, I see that only two threads are processing the data! But I want to use multiple threads to do it faster..!
So the question is What am I missing in my script to use more threads? or what is the problem?
Additionally, I have multiple files, I am wondering if I can input all of them into a single
bwa mem run. Example of my files organisation:
L1_R1.fastq.bzip2 L1_R2.fastq.bzip2 L2_R1.fastq.bzip2 L2_R2.fastq.bzip2 L3_R1.fastq.bzip2 L3_R2.fastq.bzip2