BWA无法找到本地索引文件

时间:2017-06-04 17:20:29

标签: bioinformatics fasta samtools

我目前正在尝试将.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

1 个答案:

答案 0 :(得分:2)

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