This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bwa: fail to locate the index files

Hi all,

I'm trying to align a fastq file to a reference fasta file using bwa mem and for the life of me I keep getting the following error message. Any thoughts? Thanks!

bwa index -a bwtsw myref.fasta -p myref
ls
myref.amb  myref.bwt  myref.pac
myref.ann  myref.fasta    myref.sa
  
bwa mem -M 1 -R '@RG\tID:{foo}.{bar}\tPU:{foo}.{bar}.{999999}\tSM:{999999}\tPL:{foo}\tLB{bar}' myref myfastq.fastq.gz

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

Sorry about the weird formatting; this is my first post to Biostars.

Did you try myref.fasta instead of just myref?

1 answer

I am not sure, but I think the cause of the error is the -M parameter doesn't take any values:

         -M        Mark shorter split hits as secondary (for Picard compatibility).
  

Try with:

bwa mem -M -R '@RG\tID:{foo}.{bar}\tPU:{foo}.{bar}.{999999}\tSM:{999999}\tPL:{foo}\tLB{bar}' myref myfastq.fastq.gz

Nice, you can upvote (thumb up) an answer that was useful, or even accept that answer.

Log in to answer this question.