Given a sorted/indexed BAM file (or SAM file if that is easier) which was produced by aligning PE reads to a reference genome, how can I enumerate the:
1) number of read pairs with both reads mapping to a particular chromosome
2) number of read pairs with only one of the reads mapping to a particular chromosome
i.e. scenario #1
--R1--> <--R2--
scenario #2
--R1-->
OR
<--R2--