This is a test version of Biostars. For the public version, visit https://www.biostars.org.
[E::bwa_idx_load_from_disk] fail to locate the index files [main_samview] fail to read the header from "-"

Hi! I'm new in this world and I need help to understand how to overcome the problem that I have. I used bwa mem for the alignment of a sample with hg38 reference genome and got this error, can't really understand why. The code that I'm running is this one:

bwa mem \
  /home/arturo/Documenti/hg38.fa /home/arturo/Documenti/PATIENT/PATIENT_TRIMMED/PATIENT-BM_S7_L001_R1_001_trimmed.fastq.gz \
  /home/arturo/Documenti/PATIENT/PATIENT_TRIMMED/PATIENT-BM_S7_L001_R2_001_trimmed.fastq.gz | \
    samtools view -bS - > /home/arturo/Documenti/PATIENT/PATIENT_BAM/PATIENT_BM_unsorted.bam

The output is:

[E::bwa_idx_load_from_disk] fail to locate the index files [main_samview] fail to read the header from "-".

What could be wrong here?

I have also another question: the hg38 reference genome should be unzipped once downloaded or not?

samtools bwa

1 answer

Hi,

before you start alignemnt you need to create BWA index of your reference FASTA file.

Go to folder located your reference fasta and run command:

cd /home/arturo/Documenti/

bwa index hg38.fa

It create in current directory ne files (takes some time):

*amp, *ann, *bwt, *pac, *sa 

Those files are use for alignment step. Then re-run your command.

Best,

Paul

First of all Thank you for the answer! I have already created the BWA index of my FASTA file which are the same as you listed above (i think you were ment to write amb instead of amp). I've tried to run the code also with those files but still getting the same error.

bwa mem /home/arturo/Documenti/hg38.amb /home/arturo/Documenti/PATIENT/PATIENT_TRIMMED/PATIENT-BM_S7_L001_R1_001_trimmed.fastq.gz /home/arturo/Documenti/PATIENT/PATIENT_TRIMMED/PATIENT-BM_S7_L001_R2_001_trimmed.fastq.gz | samtools view -bS - > /home/arturo/Documenti/PATIENT/PATIENT_BAM/PATIENT_BM_unsorted.bam

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

[main_samview] fail to read the header from "-"

Could also be a problem of where my BWA index files are? I have it in the same directory of the hg38 FASTA file

did you find a solution to this?

Please use for reference input fasta no .amb:

bwa mem /home/arturo/Documenti/hg38.fasta .......

Not to use

bwa mem /home/arturo/Documenti/hg38.amb .......

Le me know if it works.

Best,

Paul

Log in to answer this question.