No need to sort in the second command.
Used the samstat tool (http://samstat.sourceforge.net/) for seeing the mapq scores of my alignment;
First, I used with the accepted_hits.bam, and found some reads classified as unmapped. And, I thought strange. Shouldn't the accepted hits contain only mapped reads?
Second, When I use the samstat against unmapped reads.bam, all reads are 30 + mapq scored.
Can someone explain this to me?
1 answer
As the following command gave you 756288 255, this indicates all the reads in unmapped.bam have mapping quality of 255, which indicates that the mapping quality could not be assigned to them, hence they are all can be considered as unmapped. If you run the same command on accepted_hits.bam, you should see MAPQ of 0,1,3,50.
samtools view unmapped.bam | cut -f5 | sort | uniq -c
You can also run the following command and see if all the reads have reference name as *. This also indicates the reads mapped to no chromosomes.
samtools view unmapped.bam | cut -f3 | sort | uniq -c
More one thing, shouldn't the accepted_hits.bam have 0 unmapped reads? Must have something wrong with my alignment. as you can see here:
There are 0.5% unmapped reads on the accepted_hits.bam: http://s28.postimg.org/wunusnl71/Untitled.png)
MAPQ is not for all bases. its for read. All unmapped reads in tophat output will have MAPQ of 255, which indicates that the MAPQ can not be calculated for them.
Log in to answer this question.
Can you post the output of
I found strange that my accepted_hits has unmapped reads. Also, The unmapped.bam has 30+ mapq.