Hi to all I have a question about Number of threads in bwa. Does it (Number of threads) any effect on the final result? or only affect on analyzing time.
Hi to all I have a question about Number of threads in bwa. Does it (Number of threads) any effect on the final result? or only affect on analyzing time.
Ok, as d-cameron points out below the situation I originally described is the case for Bowtie2, but not BWA. Apparently, BWA guarantees deterministic output order even when running concurrently with many threads (as Heng points out here). Thanks, d-cameron, for pointing this out.
Original (wrong) assumption preserved for posterity: <del>What do you mean by affect the final result? If you increase the number of threads, the _order_ in which alignments appear in the resulting BAM file may be different. This is because each thread will grab a group of reads and align them, and there is no strict ordering on the order in which these threads will finish aligning. Thus, if you run BWA in parallel with different numbers of threads (and don't sort the output), then you can expect that records can appear in the output in different orders for different runs. However, there should be no difference on the actual alignments that are returned for the reads --- that is, mapping quality will certainly not decrease in any way as the number of threads increases.</del>
It does not. Heng Li, the author of bwa has previously commented on the determinism (or lack thereof) in bwa: A: BWA mem output inconsistent on same but re-ordered FASTQ input
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Thank you, much more relevant answer than mine.
Thank you so much. I mean if once I run bwa with 6 threads and once again repeat this with 12 threads then I have different results(output)?
Technically, yes - the output will be "different". But will that affect downstream analysis? Not if both runs were run properly with the same input data and parameters (except number of threads of course).
bwa alignment is deterministic and the output will be the same. It will only be different if you reorder your input fastq.
Thank you. I should have had more faith in the developer :-)
Your results will be the same regardless of the number of threads used.
This is incorrect. bwa mem outputs SAM record in the same order as the input fastq regardless of the number of threads. Bowtie2 on the other hand requires an extra parameter (--reorder) to ensure deterministic ordering.