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
bitwise flag in SAM file win804 Bioinformatics 25 02-04-2013 08:56 PM
sam flag is confusing poorphd Bioinformatics 6 01-11-2012 10:46 AM
BWA output bitwise flag for mapped/unmapped reads wenhuang Bioinformatics 1 08-29-2011 03:54 PM
Flag=4 in SAM Rachelly Bioinformatics 2 12-22-2010 02:54 AM

Reply
 
Thread Tools
Old 10-07-2010, 05:00 AM   #41
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,541
Default

In the context of SAM/BAM, and "pair" is two reads from either end of the same fragment of DNA; the "mate" is the partner read in a pair of reads.

Thus if you are looking at the forward or /1 read, the mate is the reverse or /2 read, and vice versa). The pair is the combination of the forward and reverse reads (or the /1 and /2 reads depending on your naming convention).

With that in mind, does the FLAG bit field make more sense?
maubp is offline   Reply With Quote
Old 10-07-2010, 06:55 PM   #42
northbio
Junior Member
 
Location: china

Join Date: Sep 2010
Posts: 4
Default

Thank you, maubp. I follow your explation, so in my opinion,
0x0008 the mate is unmapped
0x0020 strand of the mate
the two bit is only used if the data is in mate pattern, not useful in pair-end data?
northbio is offline   Reply With Quote
Old 10-08-2010, 01:34 AM   #43
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,541
Default

Quote:
Originally Posted by northbio View Post
Thank you, maubp. I follow your explation, so in my opinion,
0x0008 the mate is unmapped
0x0020 strand of the mate
the two bit is only used if the data is in mate pattern, not useful in pair-end data?
If you have an unpaired read (i.e. singleton read where FLAG bit 0x0001 is not set), then it has no mate (no partner) so yes, 0x0008 and 0x0020 are meaningless and should not be set.
maubp is offline   Reply With Quote
Old 10-25-2010, 07:43 AM   #44
SH1
Junior Member
 
Location: Baton Rouge, LA

Join Date: Mar 2010
Posts: 4
Default

Hello -
This may be a naive question, but if the bitwise flag is 4 in a .sam file, shouldn't there always be an asterisk in the RNAME column? I'm getting reads that have a 4 in the FLAG column but also a legitimate reference in the RNAME column. If I understand correctly (which I may not), the RNAME column refers to the place that read maps to, yet a 4 in the FLAG column means it's unmapped. ??? Any help on this would be greatly appreciated - I think I'm throwing out aligned reads because of the 4 in the FLAG column and that is suboptimal. Thank you!!!
SH1
SH1 is offline   Reply With Quote
Old 07-05-2011, 08:42 AM   #45
shruti
Member
 
Location: Milan

Join Date: Mar 2010
Posts: 35
Default

Hi.. I have problem in understanding the flag too. I used bwa sampe for alignment & have used picards http://picard.sourceforge.net/explain-flags.html to decipher the meaning of the flags.

Below is the flags and its description
99 -
read paired
read mapped in proper pair
mate reverse strand
first in pair

151 -
read paired
read mapped in proper pair
read unmapped
read reverse strand
second in pair

and following is an example to illustrate my doubt.

HWI-ST220_63:5:1101:6002:72582 99 chrX 166650106 0 50M = 166650248 192 TAGGGTTAGGGTTAGGGTTAGGGGTTAGGGTTAGGGTTAGGGTTAGGGTT [email protected] XT:A:R NM:i:0 SM:i:0 AM:i:0 X0:i:9X1:i:3 XM:i:0 XO:i:0 XG:i:0 MD:Z:50
HWI-ST220_63:5:1101:6002:72582 151 chrX 166650248 0 50M = 166650106 -192 AGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAGGGTTAG BJIJIJJJIJJJJJJJJJJJJJJJJJJJJJJJJJJJJHHHGHFFFFFCCC XT:A:R NM:i:0 SM:i:0 AM:i:0 X0:i:670 XM:i:0 XO:i:0 XG:i:0 MD:Z:50

Both reads are repetitive and shows a reference to which it maps however one read shows the value 99 while its mate shows 151. How is that one is assigned a value which says mapped (as in 99) and the other unmapped (as in 151) unless the meaning as provided in picard is wrong or my understanding..
shruti is offline   Reply With Quote
Old 07-05-2011, 09:54 AM   #46
swbarnes2
Senior Member
 
Location: San Diego

Join Date: May 2008
Posts: 912
Default

No, that is the correct interpretation of the flags. 8 is also the flag for "mate is unmapped", which in theory, the first read should have, since it has the 4 flag for being unmapped itself. I'd guess that the 4 flag in the second read is an error, but it's hard to explain. One weirdness that I know bwa has when aligning is it concatenates separate reference sequences, so if a read crosses over two references, it's have a mapping position, and be flagged as unmapped (PICARD yells at you when it sees this), but that wouldn't seem to explain what you have there.

And no, unmapped paired reads might not have an * in the rname. If a read is unmapped, and its mate is mapped, it's supposed to have the rname and position of its mate. That's so they will sort together. It's not a bug, it's a feature, really. The flag is supposed to show this, maybe the ISIZE field will too.
swbarnes2 is offline   Reply With Quote
Old 07-05-2011, 04:23 PM   #47
shruti
Member
 
Location: Milan

Join Date: Mar 2010
Posts: 35
Default

thank you for the reply.

In the example of my previous msg the reads have different coordinates and so essentially they are mapped. I had also tried doing a blat of the sequence on the mouse whole genome (mm9) and both of them show multiple hits.

Just for clarity, below are the best hits for both the reads. the latter read has many hits.
---------------------------------------------------------------------------------------------------
browser details read1_flag99 50 1 50 50 100.0% 9 - 115259995 115260044 50
browser details read1_flag99 50 1 50 50 100.0% 9 - 95326385 95326434 50
browser details read1_flag99 50 1 50 50 100.0% X + 166650106 166650155 50
browser details read1_flag99 50 1 50 50 100.0% 2 + 181747899 181747948 50
browser details read1_flag99 50 1 50 50 100.0% 2 + 57481930 57481979 50

browser details read2_flag151 50 1 50 50 100.0% 9 - 95326353 95326402 50
browser details read2_flag151 50 1 50 50 100.0% 6 - 50997472 50997521 50
browser details read2_flag151 50 1 50 50 100.0% 6 - 4873828 4873877 50
browser details read2_flag151 50 1 50 50 100.0% 6 - 4874144 4874193 50



Also I would expect that if a read is mapped & the mate pair is unmapped then the flag for the read could not be 99, it may be the values 75 / 91 / 139 / 155. but then I might be wrong.

Just to clarify "mate reverse strand" means that the mate pair is mapped in reverse strand?
shruti is offline   Reply With Quote
Old 08-01-2011, 07:35 AM   #48
stonyc
Junior Member
 
Location: Michigan

Join Date: Jan 2010
Posts: 1
Default Flag = *?

Hi, I am mapping 454 reads with the default bwa bwasw, and I'm mostly getting good results, but a couple have me stumped...

I understand that the FLAG of 4, with aligned chromosomal coordinates indicates an alignment possibly spanning across multiple chromosomes.

But, I'm also getting a few alignments like this:

GVVGYHW01CSFZ8 * chrIII 7855436 199 139M * 0 0 GATCTGCCAAGCAACAGGCTAAGTCTCGCAATCAAGCCGTCAGAAAGTTCGCAGTCAAGGCTTAAGTGGCTTGTATTCATTGTTATCCATTCATGGACATTGTTCTGGTTCAATTTCAATGAAAATTGTTGCTTATGTT @BEEA<<552275<----/8//66B<<@BIIII[email protected]AA=EABACB?455;IIIIIIIIIIIIIIIIIIIIIIIHDDDI AS:i:139 XS:i:0 XF:i:3 XE:i:4 XN:i:0

As you can see, the FLAG for this alignment is "*"... is this similar to the FLAG=4 situation described above, or something else entirely?

Thanks...
stonyc is offline   Reply With Quote
Old 11-24-2012, 11:01 PM   #49
edge
Senior Member
 
Location: China

Join Date: Sep 2009
Posts: 199
Default

Hi,

Is it 16 refer to read map at reverse strand?
Can I know which bitwise flag refer to those read that map in pair?

Thanks.
edge is offline   Reply With Quote
Reply

Tags
format, quality, sam

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 12:41 AM.


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