Unconfigured Ad

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

    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
                Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                by SEQadmin2



                Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                Today, 05:17 AM
              • GATTACAT
                Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                by GATTACAT
                Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                07-01-2026, 11:43 AM
              • SEQadmin2
                Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                by SEQadmin2


                I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                Here are nine questions we think about, in roughly the order they matter, before...
                06-18-2026, 07:11 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, Yesterday, 11:05 AM
              0 responses
              7 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-02-2026, 11:08 AM
              0 responses
              29 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-30-2026, 05:37 AM
              0 responses
              28 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-26-2026, 11:10 AM
              0 responses
              27 views
              0 reactions
              Last Post SEQadmin2  
              Working...