BWA mem failing to locate index files
0
1
Entering edit mode
4.8 years ago
aalith ▴ 10

I've seen a million forum posts about this topic, however, I still cannot figure out the issue with my command line

I indexed my reference genome (hg38... Homo_sapiens_assembly38.fasta) with bwa and samtools to create files with the same name + .fai .pac .amb .ann .bwt .dict .sa

The index files and ref genome are in the same folder

I downloaded bwa in a gatk docker image (so apt-get install bwa). My fastq file is in the home directory

Here is my command line

bwa mem -M -p -t 12 /mydata/RefGenomes/hg38/Homo_sapiens_assembly38.fasta f797.fastq > f797.sam

Error message

[E::bwa_idx_load_from_disk] fail to locate the index files
bwa index • 7.2k views
ADD COMMENT
0
Entering edit mode

What command did you use to create the index? There was no error during that process?

ADD REPLY
0
Entering edit mode
bwa index -p Homo_sapiens_assembly38 -b 1000000000 -a bwtsw /path/to/Homo_sapiens_assembly38.fasta

I think this ran with no problem. It spit back out the 5 index types that I indicated above. I renamed each file to have the prefix "Homo_sapiens_assembly38.fasta." It also printed this..

Finished constructing BWT in 27 iterations.
[bwa_index] 2601.39 seconds elapse.
[bwa_index] Update BWT... 20.59 sec
[bwa_index] Pack forward-only FASTA... 20.92 sec
[bwa_index] Construct SA from BWT and Occ...
1083.39 sec
[main] Version: 0.7.12-r1039
[main] Real time: 3954.316 sec; CPU: 3753.260 sec
ADD REPLY
0
Entering edit mode

I renamed each file to have the prefix "Homo_sapiens_assembly38.fasta."

Why? You had provided a prefix name Homo_sapiens_assembly38 for your index. Just use that prefix name in your alignment. Do not change file names after running the indexing.

ADD REPLY
0
Entering edit mode

I originally didn't rename them when I ran my bwa mem command, and it still gave the same error. Should I make my .dict and .fai indices have the same name as the other 5 bwa index files?

ADD REPLY
0
Entering edit mode

You made the .dict and .fai files for GATK/some other software? Those should not be needed for bwa.

ADD REPLY
0
Entering edit mode

Yea, downloaded them from the GATK bundle FTP, I think.

I also tried inputting the path to the reference genome folder and indices instead of the fasta file itself. Still didn't work

ADD REPLY
1
Entering edit mode

After the index creation did you move any of the files around? Does the following work?

bwa mem -M -p -t 12 /full_path_to_folder_with_index_files/Homo_sapiens_assembly38  f797.fastq > f797.sam
ADD REPLY
0
Entering edit mode

I moved the index files from docker to the folder in my hard drive with the ref genome. I will try this command in a bit

ADD REPLY

Login before adding your answer.

Traffic: 2321 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6