A Question About Samtools Flag "87"
1
0
Entering edit mode
11.8 years ago
lwc628 ▴ 230

I was parsing through my alignment file(sam file), and spotted the flag that seemed interesting.

Samtool flag 87 indicates( I used http://picard.sourceforge.net/explain-flags.html):

read paired
read mapped in proper pair
read unmapped
read reverse strand
first in pair

But how can a read be "mapped in proper pair" and "unmapped" at the same time?

samtools • 3.5k views
ADD COMMENT
2
Entering edit mode

what is your aligner ?

ADD REPLY
0
Entering edit mode

I use BWA 0.5.9 and samtools 0.1.7

ADD REPLY
0
Entering edit mode

Can you provide the read pair so that we can try to reproduce this output? What version of samtools are you using?

ADD REPLY
0
Entering edit mode

they look like:

CWS01-ILLUMINA:22:FC:3:1:1954:990 87 ENSMMUT00000038271 647 29 7S40M29S = 571 -116 ATCCCACTAAAAATCTTTGAGATAGGACCTGTACTTACCCTGTAAATAACCCCGCTTACTCTCTCTCTCTCCCCTN ############################################################################ XT:A:M NM:i:3 SM:i:29AM:i:29 XM:i:3 XO:i:0 XG:i:0 MD:Z:13A12T4T8 CWS01-ILLUMINA:22:FC:3:1:1954:990 163 ENSMMUT00000038271 571 29 76M = 647 116 GTCTATTACGGACAATGCTCAGAAATCTGTGGCGCAAATCACAGCTTCATACCAATTGTCGCAGACCTAATCCCAC IDIGBGG@8@>BBFBBGE@D<EG4GFF<F@ECF?CGGGGDG&lt;+GDGGGIFHIBHEGEGBGE@DGB,&lt;=?=EIGGBB XT:A:U="" NM:i:3="" SM:i:29="" AM:i:29X0:i:1="" X1:i:0="" XM:i:3="" XO:i:0="" XG:i:0="" MD:Z:41T17T5G10<="" p="">

ADD REPLY
4
Entering edit mode
11.8 years ago
Andreas ★ 2.5k

First, this is formally okay. The SAM specification says: "Bit 0x4 is the only reliable place to tell whether the segment is unmapped. If 0x4 is set, no assumptions can be made about RNAME, POS, CIGAR, MAPQ, bits 0x2, 0x10 and 0x100 and the bit 0x20 of the next segment in the template." In other words: if the "segment unmapped" bit is set, then the "read mapped in proper pair" bit doesn't mean anything anymore.

One scenario where this can happen, is if you align read pairs with BWA and one read maps to a chromosome end and goes over the end (e.g. circular chromosomes like chrM or bacterial genomes). That read is then set to unmapped by BWA, even though all the other flags are kept as they were and even the mapping positions are kept in the SAM output. See also Paired-End Sam Flag Mismatch During Filtering post.

Andreas

ADD COMMENT

Login before adding your answer.

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