bam文件 查看染色体_如何计算bam文件中每个染色体的读取次数?

bam文件 查看染色体

How to count the number of reads in each chromosome in a bam file? The bam file is already sorted by the chromosome names.

如何计算bam文件中每个染色体的读取次数? bam文件已按染色体名称排序。

If the bam file is indexed, you may quickly get these info from the index:

如果bam文件已建立索引,则可以从索引中快速获取以下信息:

samtools idxstats in.bam | awk '{print $1" "$3}'

If the bam file is not indexed, you may “count” it by uniq:

如果bam文件未建立索引,则可以通过uniq “计数”它:

samtools view in.bam | awk '{print $3}' | uniq -c

(if it is a sam file like in.sam, replace the samtools view in.bam with cat in.sam)

(如果它是in.sam之类的sam文件, samtools view in.bam cat in.sam替换为samtools view in.bam cat in.sam

In both cases, samtools provides the tools to parse/show the bam file content.

在这两种情况下, samtools提供了用于解析/显示bam文件内容的工具

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-count-the-number-of-reads-in-each-chromosome-in-a-bam-file/

bam文件 查看染色体

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值