Hey all, I've been working on Bash script to map some genes to a reference sequence. I'm using BWA for that, and I keep getting an error message that BWA has failed to locate the index.
Here's my code below:
#!/bin/bash bwa index $1 samtools faidx $1 bwa mem -t $1 *fastq.gz > aln_se.sam samtools view -bt *fasta.fai aln_se.sam > aln_se.bam samtools sort aln_se.bam -o aln.sorted.bam samtools index aln.sorted.bam samtools flagstat aln.sorted.bam
I've already indexed the fasta file containing my sequence. And during the first few times I've tried this, all the indexes generated by BWA index and samtools faidx were inside the same directory
Based on what I was reading on other bioinformatics forums, some have said moving their indexes to another directory has worked for them. Unfortunately it hasn't worked for me.
If anybody knows what's up with this error, or what is wrong with my code, I'd love to know. And do feel free to tell me if I can add more information to help clarify. Thanks for your help!