From: Peter C. <p.j...@go...> - 2013-02-21 18:02:53
|
On Thu, Feb 21, 2013 at 5:13 PM, James Bonfield <jk...@sa...> wrote: > On Thu, Feb 21, 2013 at 02:47:06PM +0000, James Bonfield wrote: >> "Bit 0x4 is the only reliable place to tell whether the segment is >> unmapped." >> >> ... >> >> "If 0x4 is set, no assumptions may be mae about [...] the bit 0x20 >> of the next segment in the template". > > While on the topic of this, I see it also says flag 0x10 is undefined > if 0x04 is set. > > This has dire consequences for bam2fastq convertors as any unmapped > reads cannot be converted back to fastq without making a decision one > way or the other as to whether 0x10 (reverse comp) is valid. > > I see that bwa occasionally outputs nonsensical cigar strings and > flags due to issues with mapping across two references. In these cases > does it also set 0x10 if it reverse complemented the sequence? > > I believe we should tighten up the spec and state explicitly that flag > 0x10 is valid and correct for unmapped reads. Ie if it states the > sequence is complemented, then it is. > > James Hi James Why is there a problem in the spec? If you have an unmapped read, it cannot be marked as reverse complemented (under the current SAM/BAM FLAG definition), therefore it must be stored in the original direction. Any code storing a reverse complemented SEQ and QUAL but setting the 0x10 bit for an unmapped read (0x4 set) is broken. (Or is there a strong case to support this currently invalid usage that is currently escaping me?) Peter |