I have aligned a bunch of paired end samples to a reference genome using tophat. For each sample I then get an accepted_hits.bam and an unmapped.bam file.
When I use
I get 38216419 reads mapped, which is fine. It's what I should expect, all the reads in accepted hits are mapped to the genome. I can drop the -F 4 and get the same number.
When I use htseq-count though:
I get 21593773 (by recording the output and adding up all the counts). This includes __no_feature, __ambiguous, etc. Why the two different numbers? It's not as if one of them if individual reads and the other read total, as one isn't twice the other. Surely if everything is mapped to the reference genome, then the total from htseq-count should be the same as the samtools count, given that the htseq-count should include all the counts mapped to non-coding regions in the genome?
When I use
Code:
samtools view -c -F 4 accepted_hits.bam
When I use htseq-count though:
Code:
htseq-count -f bam -r name -o codingRNA -t gene -i ID accepted_hits.bam actinidia.gff
Comment