Seqanswers Leaderboard Ad

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

    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

              • seqadmin
                Pathogen Surveillance with Advanced Genomic Tools
                by seqadmin




                The COVID-19 pandemic highlighted the need for proactive pathogen surveillance systems. As ongoing threats like avian influenza and newly emerging infections continue to pose risks, researchers are working to improve how quickly and accurately pathogens can be identified and tracked. In a recent SEQanswers webinar, two experts discussed how next-generation sequencing (NGS) and machine learning are shaping efforts to monitor viral variation and trace the origins of infectious...
                03-24-2025, 11:48 AM
              • seqadmin
                New Genomics Tools and Methods Shared at AGBT 2025
                by seqadmin


                This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

                The Headliner
                The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
                03-03-2025, 01:39 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 03-20-2025, 05:03 AM
              0 responses
              42 views
              0 reactions
              Last Post seqadmin  
              Started by seqadmin, 03-19-2025, 07:27 AM
              0 responses
              53 views
              0 reactions
              Last Post seqadmin  
              Started by seqadmin, 03-18-2025, 12:50 PM
              0 responses
              38 views
              0 reactions
              Last Post seqadmin  
              Started by seqadmin, 03-03-2025, 01:15 PM
              0 responses
              194 views
              0 reactions
              Last Post seqadmin  
              Working...