This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bwa Alignment Failed

When I use new version BWA 0.7.5a to align my 78bp pair-end reads with reference genome under Linux, Index the genome and generate alignments in thesuffix array coordinate, everything went well... However, when I apply generating alignments in the SAM format, it showed unexpected end of file. Then I upload my pair-end reads to Galaxy platform and apply the BWA for Illumina alignment tool. it showed

The alignment failed. Error generating alignments. [bwa_sai2sam_pe_core] convert to sequence coordinate... [infer_isize] fail to infer insert size: too few good pairs

I used the commands in Linux as follows and believe Galaxy should use the same too...

Bwa index -a bwtsw ref.fa

Bwa aln ref.fa read.fq.gz > Read.sai

Bwa sampe ref.fa read.sai read.fa.gz > aln.sam

I do not figure out what is the problem is? My forward reads are very good after QC ( no duplicates, no overrepresent sequence and no Kmer sequence) and my reverse reads are ok ( no dupdlicates, no overrepresent sequence but has some Kmer sequences).

Is that possible that my reverse reads are bad for BWA alignment and following steps???

bwa

Did you do both the forward and reverse strands?

bwa aln ref.fa fwd_read.fq.gz > fwd_read.sai

bwa aln ref.fa rev_read.fq.gz > rev_read.sai

bwa sampe ref.fa fwd_read.sai rev_read.sai fwd_read.fq.gz rev_read.fq.gz> aln.sam

I believe this is correct. You're not using bwa correctly. Read the documentation about how to align paired data.

3 answers

I did both strands. However, I found that when I do generating alignments in the SAM format with two strands separately, it works. So next step is merge two SAM formats of both forward and reverse reads.. Am I right?

Can you post the exact commands you are running? It's hard to figure out what's going on otherwise. In your example in the question, you only gave one read to sampe. That's not right.

The error message means that BWA failed to guess the insert size of your paired-end reads. That can happen if the order of reads is different between your two fastq files.

The OP is running sampe with only one read, which doesn't make sense. I think the error stems from that, but maybe they're doing something different from what they posted. They said they ran (erroneously):

Bwa sampe ref.fa read.sai read.fa.gz > aln.sam

Oops. Didn't see that. Agreed: sampe with just one read shouldn't work anyway.

I agree with Andreas; mispaired reads is the most likely cause of our problem.

So start by looking at your data. You have separate read 1 and read 2 .sams? So look at the first ten lines or so. Did they map? Are the reads really paired right? Is the insertion distance between them sane?

Log in to answer this question.