I'm trying to understand how Samtools stats designates mapped reads as "inward oriented pairs". I have a mate-pair library contaminated with paired end reads, so I would like to extract the PE reads as an independent file. So far I have the following based on flags and insert sizes:
FLAG 83, Insert is negative
FLAG 163, Insert is positive
FLAG 99, Insert is positive
FLAG 147, Insert is negative
The number of reads I get based on the above is ~5% less than that given in the stats output. Any ideas what else is included, or suggestions for how to do this completely differently?