lh3 / bwa

Burrow-Wheeler Aligner for short-read alignment (see minimap2 for long-read alignment)
GNU General Public License v3.0
1.55k stars 556 forks source link

Some Alignments Have Impossible Flag Values #235

Open DarioS opened 5 years ago

DarioS commented 5 years ago

I mapped whole genome sequencing data using the -a option. Some alignments have a Flag total of 377 and 441. According to Explain SAM Flags internet tool, 377 includes mate unmapped, read reverse strand, mate reverse strand. How could the mate be unmapped, but also on the reverse strand? Similarly, 441 has the same issue of being contradictory. I came across this by chance because I was trying to decide what value to provide to samtools view -f to explore all of the alignments added by the -a option of bwa mem. It could be more explicitly documented, similar to #206 request.

quokkamole commented 5 years ago

I've encountered the same problem.

I have paired reads where one has a SAM flag total of 117 and the other has a value of 185. In both cases, these values indicate that the unmapped read is associated with the reverse strand.

The alignment were bwa mem PE alignments with -M flag.

Edit:

This situation also seems to be described here:

https://www.cureffi.org/2012/12/19/forward-and-reverse-reads-in-paired-end-sequencing/

and here:

https://www.biostars.org/p/94213/