This is a test version of Biostars. For the public version, visit https://www.biostars.org.
RNA seq samtools flagstat

Hi all

I am getting flagstat outputs ( alining with STAR)

0 + 69618651 in total (QC-passed reads + QC-failed reads)
0 + 0 duplicates
0 + 65533095 mapped (-nan%:94.13%)
0 + 69618651 paired in sequencing
0 + 34809894 read1
0 + 34808757 read2
0 + 65506940 properly paired (-nan%:94.09%)
0 + 65506940 with itself and mate mapped
0 + 26155 singletons (-nan%:0.04%)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)

however with the fastq file after aligning with tophat gives the following output mentioned below

61234565 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 duplicates
61234565 + 0 mapped (100.00%:-nan%)
61234565 + 0 paired in sequencing
31204710 + 0 read1
30029855 + 0 read2
38945352 + 0 properly paired (63.60%:-nan%)
57200332 + 0 with itself and mate mapped
4034233 + 0 singletons (6.59%:-nan%)
2449354 + 0 with mate mapped to a different chr
282168 + 0 with mate mapped to a different chr (mapQ>=5)
rna-seq

What is the question ?

"why is samtools flagstat output different for STAR and TopHat results" :-)

I thought so ^^ In that case, it could help to have to have a look at the exact tophat and STAR command lines used.

Tophat by default gives only aligned reads as accepted.bam but not star. You may have checked accepted.bam hence the difference. Look at total reads from both they are different

2 answers

I guess the basic question is about the difference between STAR and tophat2 not about flagstat. You should check the reads that mapped with star but not with tophat in IGV.

STAR usually clips the reads if it could not align and tries to realign, while tophat does not, hence STAR might be mapping more reads. There could also be a difference in how many mismatched star/tophat allows. There can also be a difference in innermate distance that is allowed with star and topcoat, etc etc.

So to identify the correct reasons, you need to pull out the reads from bam file that STAR mapped but not Tophat and check them in IGV. most probably, you will find out either soft clipped reads or reads with multiple mismatches.

As suggested in comments, post the exact commands used for both the alignments and also any preprocessing done on bam files, as the stats does not follow a pattern.

here is the thread What Does Samtools Flagstat Results Mean?

He is not asking about what it means, he is asking why it is different between two aligner

Log in to answer this question.