Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dariober
    Senior Member
    • May 2010
    • 311

    Inconsistent SAM flag

    Hello All,

    Maybe I'm missing something trivial here...

    I have a bam file produced by bwa which contains few reads (15 reads out of 21 millions I think) where the sam flag is 20 but the read is mapped with high MAPQ. Samflag 20 should mean "read unmapped and read reverse strand" (which doesn't make sense...)

    I found this out while running picard/Downsample.
    Here's an example
    Code:
    CRIRUN_738:7:60:15550:13583#GATCAGA	20	chr15	100338908	25	36M	*	0	0	TAGGNTTCTAACCCTAACCCTAACCCTAACCCTAAC	########?B>DGGGGEGGGFGCGGGGG@GGGFGEG	XT:A:U	NM:i:2	X0:i:1	X1:i:0	XM:i:2	XO:i:0	XG:i:0	MD:Z:4G2A28
    And this is the Picard log:
    Code:
    [Thu Jun 21 10:54:03 BST 2012] net.sf.picard.sam.DownsampleSam INPUT=bam_clean/el001_6.clean.bam OUTPUT=bam_clean_downsample/el001_6.clean.8M.bam RANDOM_SEED=1234 PROBABILITY=0.3784436 VALIDATION_STRINGENCY=LENIENT    VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
    [Thu Jun 21 10:54:03 BST 2012] Executing as berald01@crinode2 on Linux 2.6.18-274.3.1.el5 amd64; Java HotSpot(TM) 64-Bit Server VM 1.6.0_21-b06; Picard version: 1.59(1062)
    Ignoring SAM validation error: ERROR: Record 4860916, Read name CRIRUN_738:7:60:15550:13583#GATCAGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 6852526, Read name CRIRUN_738:7:66:12714:8917#GATCAGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 6852527, Read name CRIRUN_738:6:65:7137:9838#ACTTGAA, MAPQ should be 0 for unmapped read.
    INFO    2012-06-21 10:54:58     DownsampleSam   Read 10000000 reads, kept 3786210
    INFO    2012-06-21 10:55:54     DownsampleSam   Read 20000000 reads, kept 7572764
    Ignoring SAM validation error: ERROR: Record 20637887, Read name CRIRUN_738:7:70:15841:5492#GATCAGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21376847, Read name CRIRUN_738:7:29:11846:7539#GGCTACA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21376848, Read name CRIRUN_738:7:50:13587:20204#GATCAGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385154, Read name CRIRUN_738:6:41:2357:8884#ATCACGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385155, Read name CRIRUN_738:6:117:19385:1870#ATCACGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385156, Read name CRIRUN_745:3:91:16809:17501#TTAGGCA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385157, Read name CRIRUN_738:6:2:15188:2232#ATCACGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385158, Read name CRIRUN_745:2:57:17289:14668#GGCTACA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385159, Read name CRIRUN_745:3:9:10303:11004#ATCACGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385160, Read name CRIRUN_745:3:50:12189:4898#ATCACGA, MAPQ should be 0 for unmapped read.
    Ignoring SAM validation error: ERROR: Record 21385161, Read name CRIRUN_745:3:73:14991:2335#TTAGGCA, MAPQ should be 0 for unmapped read.
    INFO    2012-06-21 10:56:02     DownsampleSam   Finished! Kept 8117302 out of 21438988 reads.
    [Thu Jun 21 10:56:02 BST 2012] net.sf.picard.sam.DownsampleSam done. Elapsed time: 1.98 minutes.
    How do we explain that a read has flag 20 while it is regularly mapped?

    Thanks!

    Dario
  • westerman
    Rick Westerman
    • Jun 2008
    • 1104

    #2
    I have no explanation. However if you want to do some troubleshooting what happens if you take just these reads plus a couple others as a control and run them through BWA. Do they come out with the same problem?

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      Is it possible that your read is hanging off of the end of one chromosome, onto the next?
      bwa will throw the 4 flag in those cases.
      Last edited by swbarnes2; 06-21-2012, 08:47 AM.

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • 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...
        07-08-2026, 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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      26 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-09-2026, 10:04 AM
      0 responses
      37 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-08-2026, 10:08 AM
      0 responses
      23 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-07-2026, 11:05 AM
      0 responses
      34 views
      0 reactions
      Last Post SEQadmin2  
      Working...