Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • metheuse
    Member
    • Jan 2013
    • 84

    #1

    BWA unique mapping

    The question of how to get uniquely mapped reads from BWA-MEM really gives me a headache. I've searched online and found two ways:
    1. Filter by mapq (different thresholds have been suggested: >=1, >=4, >=10, etc)
    2. Filter by requiring AS score > XS score (or furthermore requiring a ratio)

    My basic understanding is:
    1. mapq=-10log(P). When mapq=3, P=0.5. So I would think mapq>=4 would be a lower bound threshold for unique mapping
    2. AS is alignment score, while XS is suboptimal alignment score, so AS > XS should be a sound threshold for unique mapping

    However, the conflicts I got are:

    1. After I selected the alignment with AS > XS, their mapq can be down to 1 (don't know if it can be down to 0 because I started with alignment with mapq>0). For example, in the following two reads:
    HISEQ-MFG:330:C6ATHACXX:8:2115:20746:12090 99 chr10 512755 1 51M = 512885 181 AATCAAAACCACTATGAGATATCATCGCACACCAGTTAGAATGGCAATCAT CCCFFFFFHHHHHJJJJJJJJJJJJJIJJJJJJJJJJJJIJJJJJJJJJJJ NM:i:0 AS:i:51 XS:i:46 RG:Z:44188
    HISEQ-MFG:330:C6ATHACXX:8:2106:17664:83684 99 chr10 70748 27 51M = 70878 181 ACAATGCAAATCAAGTTCATTCTCACTGTGCTTGATTAACCTTCAAAATTG C@@FDFFEHHFFHIGBFGIIIIJGGIGHHIHIIGGIGGIGIIJIIJIJGI@ NM:i:0 AS:i:51 XS:i:46 RG:Z:44188
    Their AS and XS are the same, but why do their mapq differ so much?

    2. After I selected the alignment with mapq >=4, their AS can be the same as XS. For example, in the following three reads:
    HISEQ-MFG:330:C6ATHACXX:8:1101:1320:1942 147 chr8 33349191 40 51M = 33349000 -242 GTCCAGGCTGGAGTGCAGTGGTGCGATCTTGGCTCACTGCAACCTCTGCTT DAIIHGHFFGFFGHHHGIIFCC?FCGHGEGHCJGIHJIHHHHHFFFDFB@@ NM:i:0 AS:i:51 XS:i:49 RG:Z:44187
    HISEQ-MFG:330:C6ATHACXX:8:1101:3430:1929 163 chr10 100935098 40 51M = 100935153 106 CCACAGAGCCCAGCAAGCTAAGATCCACTGGCTTGAAATTCTCGCTGCCAG CCCFFFFFFHHHHJJJJJJJJJJJJJJJJJJJJJGIHJGHHIIGGGGIHGE NM:i:0 AS:i:51 XS:i:51 RG:Z:44187
    HISEQ-MFG:330:C6ATHACXX:8:1101:2657:1969 147 chr8 95238495 40 1S50M = 95238418 -127 TTCTCTCTCTCTCTCTCTCTCTCTCTCTCACACACACACACACACACACAC ;HGJIIJIIHIHIGHGHHHHIGHHIHHDGEHHHHHFIHHFHHHDEDDDB?@ NM:i:0 AS:i:50 XS:i:51 RG:Z:44187
    They all have mapq=40. But how is it possible that AS = XS in the 2nd read, and even worse, AS < XS in the 3rd read?

    I've spent days in this problem and will almost give up. I'll probably require both of mapq>=4 and AS>XS for unique mapping.
    Last edited by metheuse; 04-10-2015, 10:46 AM.
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    The problem you're having is that you're conceptualizing things in terms of single-end reads, but have a paired-end dataset

    Let's just take the example of the MAPQ 40 alignments with XS>=AS. This can happen when the other mate in the pair has a confident alignment and either (A) the other considered alignments for the read in question are on a different chromosome or (B) would violate the assumptions of alignment-pair orientation and/or fragment length. So in the example of HISEQ-MFG:330:C6ATHACXX:8:1101:2657:1969, if the other valid alignment is on chr1 or even chr8:20000000 and those have higher alignment scores, it doesn't much matter since the other mate provides a reliable anchor.

    Comment

    • metheuse
      Member
      • Jan 2013
      • 84

      #3
      Originally posted by dpryan View Post
      The problem you're having is that you're conceptualizing things in terms of single-end reads, but have a paired-end dataset

      Let's just take the example of the MAPQ 40 alignments with XS>=AS. This can happen when the other mate in the pair has a confident alignment and either (A) the other considered alignments for the read in question are on a different chromosome or (B) would violate the assumptions of alignment-pair orientation and/or fragment length. So in the example of HISEQ-MFG:330:C6ATHACXX:8:1101:2657:1969, if the other valid alignment is on chr1 or even chr8:20000000 and those have higher alignment scores, it doesn't much matter since the other mate provides a reliable anchor.
      Thanks! Your explanation makes sense.
      Then what would be a good threshold for unique mapping in PE?

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        It depends a bit on context. For BS-seq, I use 10. For RNAseq, I use 5. For SNP calling, 10 or 20 is probably good, though I don't do that enough to have a really good threshold there.

        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
        • 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

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 07:41 AM
        0 responses
        12 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 08-03-2026, 10:13 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-31-2026, 02:55 AM
        0 responses
        39 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...