Hello, I have BAM file has ~ 11M Paired-End reads I'm trying to count the number of fragments in any region. To start; my understanding is that each two(mates) count (1). With the aid of region coordinate from gtf file and BAM fields i'm trying to figure out how many fragments. In BAM file
Col 4 (POS) the starting position of the mate Col 8 (PNEXT) Position of the primary alignment of the NEXT read in the template. Col 9 TLEN: signed observed Template LENgth. If all segments are mapped to the same reference, the unsigned observed template length equals the number of bases from the leftmost mapped base to the rightmost mapped base. so the number in col 4 tells where exactly within the region this mate starts; and the number in col 8 tells the starting position of the other mate starts. col 9 (I'm still confused) does it give the length of the current mate within the region? what does it mean if there is (-)? does that mean it is located on the reverse strand?
in order to count how many fragments assign to the region I used col 4 and 8 then match them?? if i find identical sequences in one location how it would be counted?
Any explanation is greatly appreciated...
EDIT: I HAVE DONE the counting using software but I'm interested in using BAM information in counting