2017-06-04 1138 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