Samtools0.19和HTSeq0.6.1p1报错的解决方案

起因

因学习需要,使用 samtools 0.19和HTSeq0.6.1p1,遇上几个不常见的报错信息。特做记录。

类别

  1. samtools sort乱码
    表现:终端在最后完成排序后不断输出乱码
    原因:0.19版本的samtools没有添加 -o 选项,现在的教程都添加了这个参数。
    解决方案:去掉 -o 参数,直接接排序完成的文件名前缀(除.bam之外的部分)
  2. HTSeq 0.6.1p1计数报错1
    报错信息:Warning: Read HWI-D00523:166:C7106ANXX:1:2104:4424:74281 claims to have an aligned mate which could not be found in an adjacent line.
    原因:tophat2的结果默认按染色体位置排序,而没有按read name排序,HTSeq检测到了孤立的read(在双端数据中)
    解决方案:htseq之前用samtools按reads排序
  3. HTSeq 0.6.1p1计数报错2
    Error occured when processing SAM input (record #210 in file accepted_hits.bam):
    ‘pair_alignments’ needs a sequence of paired-end alignments
    原因:htseq-count generally deals well with the orphaned reads (it just issues a warning, since how these should be handled is a bit ambiguous in the specification), but I wonder if mixing paired and single-end data in one file leads to this sort of error (in fact, looking through the source code suggests that that’s the only circumstance that can lead to this).【3】
    解决方案:对bam文件进行过滤【4】
    双端:samtools view -bf 1 foo.bam > foo.paired-end.bam
    单端:samtools view -bF 1 foo.bam > foo.single-end.bam

参考

1.生信小白的RNA-seq实战历程
2.被忽视的Samtools参数
3.3
4.4

-------------本文结束 感谢您的阅读-------------
暖一下
ZJohnson wechat
扫一扫,领红包!
0%