Hello Biostars community,
I have PE samples mapped with STAR and i want to count the number of uniquely mapped reads using samtools. i did the following (using the Alex Dobin's advice in this link: https://groups.google.com/forum/#!topic/rna-star/pQbqeQd0lNY) :
SE: $ samtools view -c -q 255 -F 0x2 Aligned.out.bam
PE: $ samtools view -c -q 255 -f 0x2 Aligned.out.bam
however the SE +PE/2 read count is more the number of uniquely mapped reads in my STAR log.final.out file.
To be more specific, my calculations with samtools add up to :
34 (SE) + 70579527 /2 (PE) = 35289797.5 reads.
The star total unique mappers is 35289751 reads (ie. 46.5 reads less than the samtools count) .
I have tried with a different sample, and still get 46.5 reads more with samtools.
Does anyone know why I'm getting this discrepancy?
Thank you for your help.
Can you provide the STAR statistics log file?
I believe STAR excludes SE reads. The remaining 10 or reads are probably not included because they're either multimapped or something else.
I wouldn't worry about it, ~46 reads is very little to worry about!