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
                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, Yesterday, 11:13 AM
              0 responses
              16 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, Yesterday, 10:48 AM
              0 responses
              17 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-15-2026, 10:52 AM
              0 responses
              35 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...