Question: Unmapped paired end reads with confusing sam flag values
0
gravatar for irritable_phd_syndrom
3.4 years ago by
irritable_phd_syndrom60 wrote:

I have two reads (paired end) in my bam file generated by bowtie2.

K00194:35:H7JHYBBXX:1:1101:10653:1349   77      *       0       0       *       *       0       0    ACTGAATT  JJJJJJJJ  YT:Z:UP

K00194:35:H7JHYBBXX:1:1101:10653:1349   141     *       0       0       *       *       0       0       GATTCGCC  JJJJJJJJ YT:Z:UP

I am confused about the flag values. The first flag score (77) makes sense (0x1 = 1 = multiple segments, 0x4 = 4 = unmapped, 0x8 = 8 = next segment unmapped, 0x40 = 64 = first segment in template. The next score (141) I find confusing (0x1 = 1= multiple segments, 0x4 = 4 = unmapped, 0x8 = 8 = next segment unmapped, 0x80 = 128 = last segment in template). The confusion is the last two bits (0x8 and 0x80).

How can you have the next segment unmapped when you are the _last_ segment in the template? I would think that the value should be 133 instead?

rna-seq sam • 1.4k views
ADD COMMENTlink modified 3.4 years ago by John12k • written 3.4 years ago by irritable_phd_syndrom60
1
gravatar for John
3.4 years ago by
John12k
Germany
John12k wrote:

The "next" value for the last read/segment always wraps around in the SAM format. It's true also for flags 0x8 and 0x20, as well as RNEXT and PNEXT.

PNEXT: Position of the primary alignment of the NEXT read in the template. Set as 0 when the information is unavailable. This field equals POS at the primary line of the next read.

ADD COMMENTlink written 3.4 years ago by John12k
0
gravatar for swbarnes2
3.4 years ago by
swbarnes27.0k
United States
swbarnes27.0k wrote:

The flags say that the reads are paired, and that both are unmapped, and that one is read 1, and one is read 2. The "8" column refers to the mate, not the "next" segment.

https://broadinstitute.github.io/picard/explain-flags.html

ADD COMMENTlink written 3.4 years ago by swbarnes27.0k

That is how Picard defines flags and not strictly the SAM spec.

ADD REPLYlink written 3.4 years ago by John12k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1847 users visited in the last hour