[E::hts_idx_push] NO_COOR reads not in a single block at the end 10 -1

在分析转录组数据时,用bowtie2比对生成的bam文件,下一步call peak使用m6Aviewer,需要bam文件的index文件。所以我直接敲命令

samtools index xx.bam 
[E::hts_idx_push] NO_COOR reads not in a single block at the end 10 -1

报上面的错误。后来发现,samtools建索引时,bam或sam文件必须是排序好了的,而且必须使用samtools的默认排序方法,即坐标顺序排序。

time nohup samtools sort -@ 20 28.m6A.bam -o 28.m6A.sort.bam &

然后在进行index

原文地址:https://www.cnblogs.com/zhengzh/p/7481610.html