Hi Jing,
The FLAG field is described on page 4 of the SAM format specification:
https://samtools.github.io/hts-specs/SAMv1.pdf. It is an integer which can
take values from 0 (0b0000000000000), which means none of the flags are set
(all twelve bits are 0), to 4095 (0b111111111111), which represents a
record with all flags set (all twelve bits are 1).
An example is a record with FLAG = 153 = 0b000010011001. This corresponds
to the following flags set:
0x1 = 0b000000000001: template having multiple segments in sequencing
0x8 = 0b000000001000: next segment in the template unmapped
0x10 = 0b000000010000: SEQ being reverse complemented
0x80 = 0b000010000000: the last segment in the template
So, as a contrived example, if you wanted to view only records where SEQ is
reverse complemented (16 = 0x10 = 0b000000010000) and the read is marked as
an optical or PCR duplicate (1024 = 0x400 = 0b010000000000), you would
simply add these together (1040 = 0b010000010000) and use this value: samtools
view -f 1040 ...
See https://en.wikipedia.org/wiki/Flag_field for more details about flag
fields.
Unfortunately, I can't comment on -m or -B.
Andrew
On Wed, Mar 2, 2016 at 6:36 PM Jing meng <[email protected]> wrote:
> Dear samtools developers:
>
> I am now using samtools-1.3. I have some questions for the options in
> command samtools view. There are nine CIGAR operations, and the sum of
> lengths of these operations equal the length of query sequence. So no
> matter the value of option m, it will output all the alignment. There is no
> need for this option. And the option f,what do you mean by all bits set in
> *INT* present in the FLAG field? To my knowledge, different bits have
> different value, and it is impossible to find alignments that all bits set
> in the same value. I tried hard to understand the options -m, -f, -B for
> command samtools view, but I still do not figure out their meanings. If
> possible, could you please show me an example for these options? Thanks
> very much for your time.
>
> Best
> Jing
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Samtools-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/samtools-help
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Samtools-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/samtools-help