This is very clear, thank you! One more question, do a given pair always come together? That is, in the example above, we have 3 pairs and for each, we have one QNAME. However, in the next 3 lines of the BAM, we have the following:
SRR1144953.1448091 99 NW_008793874.1 31 60 75M = 315 359
SRR1144953.21253738 99 NW_008793874.1 74 60 75M = 366 367
SRR1144953.10190936 99 NW_008793874.1 86 60 75M = 361 350
From Flag 99, I see that read is paired and it is mapped in proper pair. However, why don't I see a pair of QNAME is above? Sorry if my questions are too simple but I couldn't figure out these details from the document.
also, this doc. is very helpful - http://samtools.github.io/hts-specs/SAMv1.pdf