Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poorphd
    Junior Member
    • Jul 2011
    • 3

    #1

    sam flag is confusing

    i mapped reads to my transcrpitome assemblied from those reads.
    there is a record in the sam file
    HWI-ST397_0000:5:1101:19602:2158#ATCTCG 20 UN57620 131 25 95M *
    0 0 GTTGATCTGAGAGTAGCAGATGCCCTCAATCTTCACATCCTTGGGCACTTTGGCGCCCATGTCA
    GTGTCAGAGGGCTGGATGCTCGTGAAGGTGC BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB XT:A:U NM:i:5 X0:i:1 X1:i:0 X
    M:i:5 XO:i:0 XG:i:0 MD:Z:11C3C11G63C1T1


    i think the flag=20, = 16+4, 16 means reverse, 4 means unmapped, but i found it can mapped from 131 on UN57620

    the mapped sequences are here, not reverse
    >UN057620
    CCCGCTATAGCCATGATCCTAGCTTGAAAATCTCGTTGCG
    GCAAAATTTATGCTTTGTCGGCGGATAAAGGAGGGTAAGT
    GTATGTTTTGTTTACAAAGAGGAATCAAATCAGTGTAGGA
    CGACAGTCTAGTTGATCTGAGCGTACCAGATGCCCTCGAT #UN057620
    GTTGATCTGAGAGTAGCAGATGCCCTCAAT #read
    CTTCACATCCTTGGGCACTTTGGCGCCCATGTCAGTGTCA #UN057620
    GAGGGCTGGATGCTCGTGAA#read
    CTTCACATCCTTGGGCACTTTGGCGCCCATGTCAGTGTCA #UN057620
    GAGGGCTGGATGCTCGTGAAGGTGC#read
  • ETHANol
    Senior Member
    • Feb 2010
    • 308

    #2
    Agree the sam flag is very confusing and I am thoroughly confused by it. The sam file documentation doesn't help.

    Can someone explain it in plain English.

    What is the flag for reads that map uniquely? Can I sort these out with a awk/sed/grep?
    --------------
    Ethan

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      The flags as such don't say if it mapped uniquely. bwa adds the XT tag. If it says XT:Z:U, that means it mapped uniquely. Ifit says XT:Z:R, then that end was repetative, but that doesn't mean tha the mate didn't map uniquely.

      The simplest explanation for that tag is that you are doing single end reads, with bwa, and this read hangs off of one reference sequence, and onto another. bwa concatenates sequences together, and when one read crosses two sequences like that, it will map them and give a 4 in the flag.

      Comment

      • nilshomer
        Nils Homer
        • Nov 2008
        • 1283

        #4
        See: http://picard.sourceforge.net/explain-flags.html

        Comment

        • yina
          Junior Member
          • Jul 2009
          • 6

          #5
          Nilshomer, thanks a lot, this app is very usefull, but I still don´t understand the logic behind the flag system...

          I have some alignemnts with flag = 0 , can someone explain this??

          Comment

          • swbarnes2
            Senior Member
            • May 2008
            • 910

            #6
            Originally posted by yina View Post
            Nilshomer, thanks a lot, this app is very usefull, but I still don´t understand the logic behind the flag system...

            I have some alignemnts with flag = 0 , can someone explain this??
            Single end reads yield only 3 possible flag values: 0,4 and 16.

            0 means the read aligned in the forward direction. 16 mean it aligned in the reverse direction. 4 means it didn't align.

            The rest of the flags are for paired end data only.

            Comment

            • yina
              Junior Member
              • Jul 2009
              • 6

              #7
              Thanks swbarnes2, I found a good explanation of the way the bitwise flag is constructed, here the link:

              Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc


              Hope it helps ETHANol and others

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                by SEQadmin2



                CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                Despite this, “CRISPR helped turn genome editing from a specialized technique into
                ...
                07-31-2026, 11:01 AM
              • SEQadmin2
                Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                by SEQadmin2


                Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                The systematic characterization of the human proteome has
                ...
                07-20-2026, 11:48 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 08-06-2026, 07:41 AM
              0 responses
              22 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 08-03-2026, 10:13 AM
              0 responses
              33 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-31-2026, 02:55 AM
              0 responses
              43 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-24-2026, 12:17 PM
              0 responses
              26 views
              0 reactions
              Last Post SEQadmin2  
              Working...