This is a test version of Biostars. For the public version, visit https://www.biostars.org.
[bwa_idx_build] fail to open file 'bwtsw' : No such file or directory

I'm trying to run bwa index, but I keep getting this error:

[bwa_idx_build] fail to open file 'bwtsw' : No such file or directory. 

My code is:

for ref in *.fa; do\
bwa index $ref -p $ref -a bwtsw\
done

The files in *.fa are: Mix1_S1_CNS.fa Mix2_S2_CNS.fa Mix3_S3_CNS.fa. They are consensus sequence fasta files generated by using samtools consensus on previously aligned bam files. I suspect these files I'm trying to use as references are causing the issue, but I don't understand why the error is related to the algorithm tag.

bwa

bwa index expects the fasta file to be provided at the end of the command line.

Usage: bwa index [options] <in.fasta>

Try changing

bwa index $ref -p $ref -a bwtsw

to

bwa index -p $ref -a bwtsw $ref

The order doesn't seem to matter. I get the same error.

Your files have any non-ACTGN characters?

0 answers

No answers yet.

Log in to answer this question.