Hi everybody,
I am having a problem understanding the output of tophat concerning the multi-mapped reads. I would like to create a barplot of the unique vs. multi-mapped vs. unmapped reads from tophat-mapped bam files. (BTW is there already a tool for doing that?)
Now I wanted to extract the multi-mapped reads from one bam file. lat us say MW6. this is the align_summary.txt file I have:
Reads:
Input : 26140314
Mapped : 25159791 (96.2% of input)
of these: 1027691 ( 4.1%) have multiple alignments (1832 have >20)
96.2% overall read mapping rate.
But when I try to count the reads manually I get this :
$samtools view bamFiles/MW6.sorted.bam | grep -w -v "NH:i:1" | wc -l
4118642
and when I use the flagstat option from samtools:
$samtools flagstat bamFiles/MW6.SE.sorted.bam
28250742 + 0 in total (QC-passed reads + QC-failed reads)
3090951 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
28250742 + 0 mapped (100.00% : N/A)
0 + 0 paired in sequencing
... (the rest is 0)
The total number of input reads is 26140314 (as it says in the align_summary file). The total mapped reads from the bam file is 28250742, as says in the samtools flagstat. I guess this conflict is due to reads which mapped multiple times, but how can I get the exact number of multiple reads?
is it just 28250742 - 26140314 = 2110428 ?
Would it be similar in paired-end and single-end mapping runs?
thanks
Assa
1 answer
The total mapped reads from the bam file is 28250742
This is the total number of alignments, which is different than the total number of reads. Reads can have 0, 1 or more alignments.
- There are 25159791-1027691=24132100 reads that map only 1 time.
- There are 1027691 reads that map multiple times.
- The 24132100 uni-reads generate 24132100 alignments.
- The 1027691 multi-reads generate 28250742-24132100=4118642 alignments including 3090951 secondary alignments.
Log in to answer this question.
Not exactly sure how to phrase this but, err, your avatar is a little... er... hm... never mind.
would you please grow up.
... I don't think that's going to help.
I see that they are your children and you probably didn't notice it looks odd to people without that piece of information (i didn't even know the silhouettes were children until just now) - however, I must say, if someone was brave enough to tell me I had overlooked something, despite the obviously embarrassing nature of the oversight, then insults are the last place i'd look for answers.
Hi Assa Yeroslaviz,
I realise I'm a bit late to join this "discussion". I don't want to suck the fun out having that picture as an avatar, since it (according to John ) is a picture of silhouettes of your children and we of course can't object to that. Knowing this, it's a nice avatar. So there is essentially nothing wrong, but we can't help that our first impression is, well, different from the truth and your intention. Perhaps I also need to grow up? What you aim to communicate is not important, it's how it comes across. Perhaps there is a great comparison here with Plato's metaphorical cave, but whatever, I don't know exactly and don't want to go down on a philosophical discussion.
If you could somehow avoid our inappropriate interpretation, I'm sure this all would blow over without further issues.
Cheers,
Wouter
I give up. I really think people here are sick!