Forum:All sam flags specifying first mate?
2
0
Entering edit mode
9.4 years ago
jyu429 ▴ 120

Is there a list of all sam flags specifying first mates in a pair?

Is there also a list of all sam flags specifying second mates in a pair?

sam • 3.0k views
ADD COMMENT
1
Entering edit mode
9.4 years ago
John 13k

Technically, there aren't flags for specifying anything in a pair, because 'is a pair' is not a flag. 'has multiple segments' however is, and since this almost always means pairs, you start by setting -f 1 to select only multi-read fragments.

To specify the first mate in a multiple-segment use the flag 64, which we add to our 1 above to give -f 65

There is no way to specify second mate in a pair, for the same reason that theres no way to specify a pair. Your options are "NOT the first read" which would be -F 65 or select for "the LAST read" which would be 128 which again we add to -f 1 to get -f 129

Personally I'd go with -f 129 because mistakes will be more obvious when -f 129 has a different number of reads than -f 65. This should (logically) never happen - but aligners be trippin' yo'

EDIT:

Sorry, in typical fashion as soon as I hit post I realised I haven't actually answered your question -_-;

I'm not going to post the 2048 different combination of flags, most of which mutually exclusive, here, but here's some python to print it out for you:

for x in xrange(0,4096):
  binary = format(x, '#014b')
  if binary[7] == '1': print eval(binary)
ADD COMMENT
1
Entering edit mode

Oh, I see. Thanks, John!

ADD REPLY
0
Entering edit mode
9.4 years ago
jyu429 ▴ 120

I'm not sure I follow? Maybe I should have been more specific. The website has certain flags which will make "first in pair" checked, like flag 83. I just want the set of all flags that make the "first in pair" checked and separately the set of all flags that make the "second in pair" checked.

ADD COMMENT
0
Entering edit mode

Ah, yeah, sorry, I realised this is what you wanted as soon as I made the first post. its 00:48am here, so I shouldn't really be posting stuff :P

I've pasted the code to solve this for first in pair. I'm sure you can figure out how to modify it for last in pair ;)

ADD REPLY

Login before adding your answer.

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