When names are assigned to the fragment, the reported lower value for mate2 occurs 1 position after its actual start in the reference. Changing the value to start_pos+fraglens[s]-readlen from start_pos+fraglens[s]-readlen+1, corrects this issue. Additionally, this change makes the difference between the start and end values consistent with mate1, readlen-1.
When names are assigned to the fragment, the reported lower value for mate2 occurs 1 position after its actual start in the reference. Changing the value to start_pos+fraglens[s]-readlen from start_pos+fraglens[s]-readlen+1, corrects this issue. Additionally, this change makes the difference between the start and end values consistent with mate1, readlen-1.