【问题标题】:BWA can't find the local index fileBWA 找不到本地索引文件
【发布时间】:2019-05-09 05:51:38
【问题描述】:

我目前正在尝试将 .fasta 文件导入 bwa,以使用参考基因​​组将我的读取映射到。但是,我目前收到此错误:

[E::bwa_idx_load_from_disk] fail to locate the index files

有什么帮助吗?这是我的代码:

#!/bin/bash

source /opt/asn/etc/asn-bash-profiles-special/modules.sh
module load fastqc/0.10.1
module load fastx/0.0.13
source /opt/asn/etc/asn-bash-profiles-special/modules.sh
module load pear/0.9.10
source /opt/asn/etc/asn-bash-profiles-special/modules.sh
module load fastqc/0.10.1
module load fastx/0.0.13   
module load bwa/0.7.12
module load samtools/1.2
source /opt/asn/etc/asn-bash-profiles-special/modules.sh
module load trimmomatic/0.35

r=20
####mapping
#Indexing reference library for BWA mapping:
bwa index -a is ~/gz_files/sample_things/fungiref.fa fungiref

bwa mem fungiref sample${r}_clipped_paired.assembled.fastq > sample${r}.sam

#sort and convert to bam
samtools view -bS sample${r}.sam | samtools sort - sample{r}_sorted

#counts and stats
samtools index sample${r}_sorted.bam
samtools idxstats sample${r}_sorted.bam > ${r}_counts.txt

【问题讨论】:

标签: bioinformatics fasta samtools


【解决方案1】:

bwa index 的用法是

bwa index [-p prefix] [-a algoType] <in.db.fasta>

您的用法与此不符;很遗憾bwa 默默地接受了这一点,而不是立即抛出错误。令人讨厌的是,也根本没有办法为索引指定路径前缀。你被引用的位置困住了。

无论如何,索引文件名都来自 FASTA 参考文件。因此,您需要在后续命令中调整索引文件名:

bwa mem ~/gz_files/sample_things/fungiref.fa sample${r}_clipped_paired.assembled.fastq > sample${r}.sam

【讨论】:

  • 感谢您的帮助!最后一个问题,不确定您是否知道:当映射回参考时,序列必须匹配多近才能被视为“映射”?我正在尝试比较不同的数据库,并且我需要知道 BWA 映射的置信度。我已经搜索了互联网,但没有找到任何东西。
  • @Haley 您可以通过传递给bwa mem 的几个选项来控制它。不幸的是,这些参数并不是微不足道的……最好的方法是查阅出版物中对 BWA MEM 算法的解释。无论如何,匹配分数 (-T) 的默认截止值是 30。该分数是使用匹配分数 (-A)、不匹配罚分 (-B) 和空位开口 (-O) 计算得出的和扩展(-E)惩罚,以及剪辑惩罚(-L)和未配对读取的惩罚(-U)。 BWA MEM 在这方面非常特殊:通常裁剪惩罚为 0,未配对读取是通过/失败。
  • 我是这么认为的.. 对于那些对他们认为映射的内容使用高截止值的映射程序,您有什么建议吗?我有一个环境样本的简短读数。
  • @Haley 我不知道如何对 BWA MEM 进行参数化,因为读取可能具有可变长度,因此绝对截止是非常不切实际的。但是,我通常只会将截止值设置为非常接近读取长度(例如,允许一两个插入缺失)。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-20
相关资源
最近更新 更多