SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
SAM flag idioms kgulukota Bioinformatics 14 08-23-2016 12:32 AM
sam flag is confusing poorphd Bioinformatics 6 01-11-2012 10:46 AM
Sam Flag 65 and 129 after BWA Tomi Bioinformatics 3 10-05-2011 12:13 PM
Flag=4 in SAM Rachelly Bioinformatics 2 12-22-2010 02:54 AM
SAM file flag problem ptong7 Bioinformatics 4 07-30-2009 03:32 AM

Reply
 
Thread Tools
Old 05-12-2010, 06:25 AM   #1
hollandorange
Member
 
Location: Holland

Join Date: May 2010
Posts: 11
Default sam flag 97 and 145

Hello,

After alignment, I got reads in the sam format with flag 97 and 145.
flag 97:
the read is paired in sequencing;
strand of the mate reverse;
the read is the first read in a pair;

flag 145:
the read is paired in sequencing;
strand of the query;
the read is the second read in a pair;

These reads are not mapped in a proper pair but both query and mate are mapped. how to explain this? could you give me an example?

Thanks
Yanju
hollandorange is offline   Reply With Quote
Old 05-12-2010, 08:07 AM   #2
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

They might be mapping to different contigs? What are the full SAM lines for these two reads?
maubp is offline   Reply With Quote
Old 05-12-2010, 08:29 AM   #3
hollandorange
Member
 
Location: Holland

Join Date: May 2010
Posts: 11
Default

The reads are looking like the following. I only have one reference sequence.

ENST000004134650_104_988_445_609_200# 97 ENSG00000141510 13261 37 36M = 14182 957 CGGTCAACCGTTTTGTAGAACAACTCCCGTCCCCTC 22222
2222222222222222222222222222222 XT:A:U NM:i:0 SM:i:37 AM:i:37 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:36

ENST000004134650_104_988_445_609_200# 145 ENSG00000141510 14182 37 36M = 13261 -957 GCGGCCACATCCTCGACGACCACGTCCCCGGTGCCC 22222
2222222222222222222222222222222 XT:A:U NM:i:0 SM:i:37 AM:i:37 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:36
hollandorange is offline   Reply With Quote
Old 05-14-2010, 11:33 AM   #4
hollandorange
Member
 
Location: Holland

Join Date: May 2010
Posts: 11
Default

anybody help?
hollandorange is offline   Reply With Quote
Old 05-14-2010, 12:33 PM   #5
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

First read, 97 == 1 + 32 + 64 == 0x1 + 0x20 + 0x40

0x0001 the read is paired in sequencing, no matter whether it is mapped in a pair
0x0020 strand of the mate (0 for forward; 1 for reverse strand)
0x0040 the read is the first read in a pair

Second read, 145 == 1 + 16 + 128 == 0x1 + 0x10 + 0x80

0x0001 the read is paired in sequencing, no matter whether it is mapped in a pair
0x0010 strand of the query (0 for forward; 1 for reverse strand)
0x0080 the read is the second read in a pair

So first read (flag 97) is on the forward strand (since it does not have 0x10 set), second read (flag 145) is on the reverse strand (since it does have 0x10 set).

Last edited by maubp; 05-14-2010 at 01:31 PM. Reason: corrected forward/reverse as discussed in next two posts
maubp is offline   Reply With Quote
Old 05-14-2010, 01:14 PM   #6
hollandorange
Member
 
Location: Holland

Join Date: May 2010
Posts: 11
Default

I think it is the other way round:
the first read (97) is on the forward strand, since the strand of the mate is 1 (reverse);
the second read is on the reverse strand.

and in both cases (97,145)
0x0002 the read is mapped in a proper pair =0
0x0004 the query sequence itself is unmapped=0 (0 means it is mapped ???)
0x0008 the mate is unmapped=0 (0 means it is mapped ???)
This means both of them are mapped? but not proper?

Last edited by hollandorange; 05-14-2010 at 01:18 PM.
hollandorange is offline   Reply With Quote
Old 05-14-2010, 01:29 PM   #7
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543
Default

Quote:
Originally Posted by hollandorange View Post
I think it is the other way round:
the first read (97) is on the forward strand, since the strand of the mate is 1 (reverse);
the second read is on the reverse strand.
Yes - I had it right the first time, but flipped in back in a hurry before leaving the computer
maubp is offline   Reply With Quote
Old 05-14-2010, 01:44 PM   #8
hollandorange
Member
 
Location: Holland

Join Date: May 2010
Posts: 11
Default

I had a detail look at the samtool manu. I found, for these reads, the inferred insert size is very large like 957. but in my setting, the insertsize_mean is 200 and std is 20.

is it the reason that they are mapped, but their mapped position is too far away and then samtool report not proper mapped?
hollandorange is offline   Reply With Quote
Old 05-14-2010, 02:03 PM   #9
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

Quote:
Originally Posted by hollandorange View Post
I had a detail look at the samtool manu. I found, for these reads, the inferred insert size is very large like 957. but in my setting, the insertsize_mean is 200 and std is 20.

is it the reason that they are mapped, but their mapped position is too far away and then samtool report not proper mapped?
The flags are set by the aligner, not samtools, so checkout the aligner's documentation. Check out the following to help you digest individual tags:
http://picard.sourceforge.net/explain-flags.html

Also, you can use the "-X" option in "samtools view" to convert the flag field to a string format.
nilshomer is offline   Reply With Quote
Reply

Tags
sam flag

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 04:19 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO