bwa error: paired reads have different names
1
0
Entering edit mode
9.1 years ago
vjmorley ▴ 30

I'm getting an error when I try to pair my reads using bwa (version 0.7.10-r789). Here's my pipeline:

Trim for quality using fastx fastq_quality_trimmer

fastq_quality_trimmer -t 20 -l 30 -Q33 -i for.fastq -o for_trimmed.fastq
fastq_quality_trimmer -t 20 -l 30 -Q33 -i rev.fastq -o rev_trimmed.fastq

Align forward and reverse reads to reference

bwa index ref.fa
bwa aln ref.fa for_trimmed.fastq > for.sai
bwa aln ref.fa rev_trimmed.fastq > rev.sai

Pair reads, for which I get the error in the following output:

bwa sampe for.sai rev.sai for_trimmed.fastq rev_trimmed.fastq > sample.sam

[bwa_sai2sam_pe_core] convert to sequence coordinate...
[infer_isize] fail to infer insert size: too few good pairs
[bwa_sai2sam_pe_core] time elapses: 0.14 sec
[bwa_sai2sam_pe_core] changing coordinates of 0 alignments.
[bwa_sai2sam_pe_core] align unmapped mate...
[bwa_sai2sam_pe_core] time elapses: 0.00 sec
[bwa_sai2sam_pe_core] refine gapped alignments... 0.07 sec
[bwa_sai2sam_pe_core] print alignments... [bwa_sai2sam_pe_core] paired reads have different names: "HWI-D00306:565:C6NPTANXX:8:1101:9745:2553", "HWI-D00306:565:C6NPTANXX:8:1101:9672:2717"

Any suggestions on how to fix this problem or remove the offending reads?

software-error alignment • 8.3k views
ADD COMMENT
3
Entering edit mode
9.1 years ago
User 59 13k

Because you're trimming your reads independently you're ensuring that their order is out of sync, bwa relies on your files being synchronised in terms of read names. Use a trimmer that can maintain the order of your fastq files by throwing out both pairs of reads if one of them fails a quality check.

Cutadapt can do paired-end aware quality and adaptor trimming.

https://cutadapt.readthedocs.org/en/stable/guide.html#trimming-paired-end-reads

ADD COMMENT
1
Entering edit mode

Thanks! I used cutadapt to trim the paired reads, and that solved the problem. I really appreciate the help!

ADD REPLY
0
Entering edit mode

As Daniel suggested that you should retrim the fastq reads using a trimmer that maintains the order of reads in the two fastq files. Trimmomatic is another paired-end aware trimmer. Alternatively, you can remove orphan reads as described here: Combining The Paired Reads From Illumina Run

ADD REPLY

Login before adding your answer.

Traffic: 2647 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6