Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • biocc
    Member
    • Jul 2008
    • 36

    #1

    the format of SAM

    hello, I do not understand the FLAG in SAM. could someone explain it. In paper " The Sequence Alignment/Map format and SAMtools", it says that According to FLAG
    163(=1+2+32+ 128), the read mapped to position 7 is the second read in
    the pair (128) and regarded as properly paired (1 + 2); its mate is mapped to
    37 on the reverse strand (32).
    and each bit in the FLAG field is defined as:
    Flag Description
    0x0001 Paired in sequencing
    0x0002 Mapped in proper read pair
    0x0004 Query unmapped
    0x0008 Mate unmapped
    0x0010 Strand of the query (1 for reverse)
    0x0020 Strand of the mate (1 for reverse)
    0x0040 First read in the pair
    0x0080 Second read in the pair
    0x0100 Secondary alignment
    0x0200 QC failure
    0x0400 Optical or PCR duplicates
    how to explain it. thanks in advance.
  • nicolallias
    Member
    • Jan 2010
    • 23

    #2
    Hi,
    Play with : http://picard.sourceforge.net/explain-flags.html
    163(=1+2+32+ 128) is in decimal
    0x00.. are hexadecimal (base 16, not 10)

    0,0010 is equivalent to the decimal 16^1 so 16.

    Comment

    • kmcarr
      Senior Member
      • May 2008
      • 1181

      #3
      biocc,

      I created a little cheat sheet for myself to be able to quickly decipher the flags in a SAM output. The bottom row lists decimal values as they would appear in the FLAG field of the SAM file and the top row provides the interpretation of the that FLAG value. In between shows the specific elements which added up to the final value (as you showed in your example.
      Attached Files

      Comment

      • gerald2545
        Member
        • Nov 2008
        • 22

        #4
        you can also use the samtools view -X option which transforms the flag to a string, human readable.
        samtools view -? for details

        Gerald

        Comment

        • biocc
          Member
          • Jul 2008
          • 36

          #5
          thanks for everyone. i understand the FLAG now.

          Comment

          • mimi_lupton
            Member
            • Oct 2008
            • 19

            #6
            Dear all,
            Thanks for the posts above, that was exactly my question. I also have a additional question. I am trying to do remove duplicates with PICARD. I get an error because my input file has secondary alignments and MarkDuplicates does not take into account the secondary alignment flag. Anyone have an idea of how to remove them?

            Any help would be really appreciated

            Comment

            • michaeltmccarthy
              Junior Member
              • Jun 2011
              • 2

              #7
              Originally posted by kmcarr View Post
              biocc,

              I created a little cheat sheet for myself to be able to quickly decipher the flags in a SAM output. The bottom row lists decimal values as they would appear in the FLAG field of the SAM file and the top row provides the interpretation of the that FLAG value. In between shows the specific elements which added up to the final value (as you showed in your example.
              Brilliant!

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                by SEQadmin2



                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                ...
                10-14-2026, 09:55 AM
              • SEQadmin2
                New Genomics Technologies Take Aim at Long-Standing Limits
                by SEQadmin2


                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                ...
                09-28-2026, 10:25 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 10-22-2026, 11:13 AM
              0 responses
              24 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 10:48 AM
              0 responses
              20 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-15-2026, 10:52 AM
              0 responses
              36 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-14-2026, 05:39 AM
              0 responses
              42 views
              0 reactions
              Last Post SEQadmin2  
              Working...