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
                16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                by SEQadmin2




                NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
                Yesterday, 06:46 AM
              • 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

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 10-28-2026, 09:57 AM
              0 responses
              29 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-28-2026, 09:51 AM
              0 responses
              18 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 11:13 AM
              0 responses
              71 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 10:48 AM
              0 responses
              48 views
              0 reactions
              Last Post SEQadmin2  
              Working...