I am getting confused with couple samtools outputs. I have run bwa-mem with -M flag to retrieve chimeric reads with 256 flag, and converted the sam file to bam file. Problem is, in the original bam file, if I want to count the lines with 256 flag, and if I want to retrieve "SA" tags, the numbers do not add up. Should not they be equal if they are both to show chimeric reads?
samtools view -h myfile.bam | grep 'SA:Z' > myfileSA_filtered.bam samtools view -f 256 -c myfile.bam 1987783
samtools view -c myfileSA_filtered.bam 300281
I expect these numbers to be the same but they are quite far away from each other. I would appreciate your help!