统计tophat map上的read数量

samtools flagstat /SRA111111/SRR111222/accepted_hits.bam

 

78406056 + 0 in total (QC-passed reads + QC-failed reads) (1)
0 + 0 duplicates
78406056 + 0 mapped (100.00%:-nan%)  (2)
78406056 + 0 paired in sequencing (3)
39915264 + 0 read1 (4)
38490792 + 0 read2 (5)
68310778 + 0 properly paired (87.12%:-nan%) (6)
73600312 + 0 with itself and mate mapped (7)
4805744 + 0 singletons (6.13%:-nan%) (8)
1208374 + 0 with mate mapped to a different chr (9)
115100 + 0 with mate mapped to a different chr (mapQ>=5) (10)

(2)=(7)+(8)

(3)=(4)+(5)

 

复制代码
Usage: samtools flagstat <in.bam>
   
$ samtools flagstat example.bam
11945742 + 0 in total (QC-passed reads + QC-failed reads) #总共的reads数
0 + 0 duplicates
7536364 + 0 mapped (63.09%:-nan%) #总体上reads的匹配率
11945742 + 0 paired in sequencing #有多少reads是属于paired reads
5972871 + 0 read1 #reads1中的reads数
5972871 + 0 read2 #reads2中的reads数
6412042 + 0 properly paired (53.68%:-nan%) #完美匹配的reads数:比对到同一条参考序列,并且两条reads之间的距离符合设置的阈值
6899708 + 0 with itself and mate mapped #paired reads中两条都比对到参考序列上的reads数
636656 + 0 singletons (5.33%:-nan%) #单独一条匹配到参考序列上的reads数,和上一个相加,则是总的匹配上的reads数。
469868 + 0 with mate mapped to a different chr #paired reads中两条分别比对到两条不同的参考序列的reads数
243047 + 0 with mate mapped to a different chr (mapQ>=5) #同上一个,只是其中比对质量>=5的reads的数量
复制代码

 

 samtools view  ./accepted_hits.bam  | cut -f1 | sort | uniq | wc -l

 

REF:

https://www.biostars.org/p/84396/

https://www.biostars.org/p/12475/

http://seqanswers.com/forums/showthread.php?t=16500

http://sourceforge.net/p/samtools/mailman/message/31201762/

http://xushengwang.blogspot.com/2010/09/interpreting-samtools-flagstat-output.html

http://genomespot.blogspot.com/2014/09/data-analysis-step-3-align-paired-end.html

http://seqanswers.com/forums/showthread.php?t=19844

posted @   emanlee  阅读(1366)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
历史上的今天:
2009-09-21 asp.net progress bar
点击右上角即可分享
微信分享提示