Does BWA MEM understand paired-end suffixes? /2 in a single FASTQ file?
2
0
Entering edit mode
3.8 years ago
ilykos ▴ 10

I am converting some .bam files into .fastq with

samtools bam2fq

The reads inside the resulting .fastq files have a suffix:

@HISEQ02:451:150310_HWI-D00446_0451_C5FG0ACXX:4:2310:2367:65733/2

65733/2

Will bwa mem understand this as paired-end .fastq or do I have to split the files into R1/R2 first?

Thanks

bwa fastq paired end • 1.4k views
ADD COMMENT
2
Entering edit mode
3.8 years ago

BWA does not understand the /1 and /2 suffixes on read names.

It can use "interleaved" format - that is where the file alternates between read1 and read2. However samtools fastq doesn't guarentee that the reads will be output in exactly interleaved order. For a start, the bam must be read name ordered. Even then you can have situations where read1 is mapped, and therefore in the bam, and read2 isn't, and therefore is excluded from the BAM, or where a read has multiple alignments that can mess up the ordering.

Does your bam file include both mapped and unmapped reads?

ADD COMMENT
0
Entering edit mode

Ah indeed, that was it. All I remember that it drove me nuts when the reads got out of sync and for a time I couldn't quite figure out why.

ADD REPLY
0
Entering edit mode
3.8 years ago

As far as I know samtools does not have bam2fq subcommand . It does have a fastq subcommand that will generate fastq files.

When it comes to mapping use two different files rather than an interleaved one.

I will also mention that the way the fastq command works for when producing a single file has many gotcha's, the records that get written can be affected by other parameters, leading to unexpected behaviors.

ADD COMMENT
1
Entering edit mode

samtools bam2fq is a synonym for samtools fastq.

ADD REPLY
0
Entering edit mode

Still need to be careful - almost all the gotcha's that apply to writing interleaved also apply to writing to two separate outfiles when using samtools fastq.

ADD REPLY

Login before adding your answer.

Traffic: 3063 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