使用 samtools 索引索引排序的对齐文件会给出“Exec 格式错误”

发布于 2025-01-12 07:47:33 字数 475 浏览 4 评论 0原文

我正在与 samtools 索引作斗争。

我已经使用“bwa mem reference.fa seq.fastq > alg.sam”进行了对齐。

使用“samtools view -S -h -b alg.sam > alg.bam”将生成的 sam 文件转换为 bam 格式。

接下来,使用“sort -h alg.bam >sorted.bam”对文件进行排序。

现在我们遇到了问题:“samtools index -b排序.bam”总是返回以下错误:

“无法打开文件“sorted.bam”:执行格式错误 samtools 索引: 无法打开“sorted.bam”:执行格式错误”

我读到 samtools 版本 1.9 经常返回此错误。但是,我安装了 samtools 版本 1.10,但仍然找不到解决此问题的方法。

I am struggling with samtools index.

I already did the alignment using "bwa mem reference.fa seq.fastq > alg.sam".

The resulting sam file was converted to bam format using "samtools view -S -h -b alg.sam > alg.bam".

Next, the files were sorted by using "sort -h alg.bam >sorted.bam".

And now we come to the problem: "samtools index -b sorted.bam" always returns the following error:

"failed to open file "sorted.bam" : Exec format error samtools index:
failed to open "sorted.bam": Exec format error"

I read that the samtools version 1.9 returns this error quite often. However, I have samtools version 1.10 installed and still could not find a way to solve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巾帼英雄 2025-01-19 07:47:33

我终于发现了错误。我们需要写
“samtools 排序 alg.bam -o 排序.bam”
然后输出可以用作 samtools 索引的输入

I finally found the mistake. We need to write
"samtools sort alg.bam -o sorted.bam"
The output can then be used as input for samtools index

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文