I have come across the following read pair in a .sam file:
read1 163 ref 100 255 10M = 101 11 AAAAAAAAAAA AAAAAAAAAAA zz:Z:fr
read2 83 ref 101 255 10M = 100 -11 AAAAAAAAAAA AAAAAAAAAAA zz:Z:fr
I'm new to SAM/BAM files, and to me it seems to be inconsistent. The start positions, CIGAR lengths, and the facts that FLAG 163 means a forward read while FLAG 83 means a reverse read indicate this situation:
+++++++++>- read1 163
-<+++++++++ read2 83
The negative sign on TLEN (-11) is also consistent with read2 being the second read, according to the SAM file spec for TLEN signs.
However, FLAG 163 also means that read1 is the second read and FLAG 83 means that read2 is the first read, so there appears to be an inconsistency. What am I missing? Judging by the positions, isn't read1 clearly the first read? This pair is apparently from an FR library, so read1 should be first while read2 is second.
Thanks! I think the language in the SAM file spec. is misleading here - "first segment in the template", "last segment in the template". Something like "first segment sequenced from a fragment", "last segment sequenced from a fragment" would be much better.