解决samtools报错:[main_samview] region "chr2:20,100,000-20,200,000" specifies an unknown reference name. Continue anyway.
根据Samtool 的manual文档介绍,如果想搜索bam文件的某段区域,需要用到以下命令:
samtools view aln.sorted.bam chr2:20,100,000-20,200,000
于是聪明的我也跟着命令搜索了这段区域的序列,结果报错:[main_samview] region "chr2:20,100,000-20,200,000" specifies an unknown reference name. Continue anyway.
搜索了一堆资料后,直到遇见了这个问题,里面有一句话是这么说的:there is no such chromosome "chr2" in the bam. try "2". 瞬间开悟,于是将命令行的chr2修改为2,见如下命令:
samtools view aln.sorted.bam 2:20,100,000-20,200,000
成功解决了
参考链接:
https://www.biostars.org/p/251354/
http://www.htslib.org/doc/samtools.html
本文来自博客园,作者:橙子牛奶糖(陈文燕),转载请注明原文链接:https://www.cnblogs.com/chenwenyan/p/9188242.html