2017-06-04 1131 views
1

我正在尝试将.fasta文件导入到bwa中,以便使用参考基因​​组将映射到我的读取映射。不过,我目前得到这个错误: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 
+0

你可能会发现自己的[手册页]更准确的帮助(http://bio-bwa.sourceforge.net/bwa.shtml)或[邮件列表](https://sourceforge.net/p/bio-bwa/mailman/) –

+0

您可能对以下生物信息学beta stackexchange站点感兴趣:https://area51.stackexchange.com/proposals/109245/生物信息学/访问 – bli

回答

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 
+0

谢谢你的帮助!最后一个问题,不知道你是否知道:当映射回参考文献时,序列必须匹配得如何被认为是“映射的”?我试图比较不同的数据库,我需要知道BWA映射的信心。我搜索了互联网,一直没能找到任何东西。 – Haley

+0

@Haley你可以通过几个选项来控制你传递给'bwa mem'。不幸的是参数不是微不足道的......最好的方法是在出版物中查阅BWA MEM算法的解释。无论如何,匹配得分('-T')的默认截止值是30.这个得分是使用匹配得分('-A'),不匹配惩罚('-B')和空位打开(' -O')和扩展('-E')惩罚以及削减惩罚('-L')和未配对读取惩罚('-U')。 BWA MEM在此非常特别:通常裁减罚分为0,而不成对的阅读是通过/失败。 –

+0

我以为这样..你有什么建议使用高截断的绘图程序来绘制他们认为的东西吗?我从环境样本中读取短文。 – Haley