Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kjlee
    Member
    • Jun 2011
    • 12

    BWA rescue of multi-mapping or unmapped reads

    In reading the BWA manual, I have come across a question that I still cannot answer. It reads:

    In paired-end alignment, BWA pairs all hits it found. It further performs Smith-Waterman alignment for unmapped reads with mates mapped to rescue mapped mates, and for high-quality anomalous pairs to fix potential alignment errors.
    So BWA will rescue mates presumably if there is a high-quality, uniquely mapping mate pair. My question is: what are the parameters that the unmapped mate have to meet to be considered correctly placed? For instance, if I have 2x100 reads, and one maps uniquely, does the other one have to map with the same stringency as I specified in the aln stage. Or if say, only 30nt of the unmapped read map, and the other 70nt do not (due to say, an inversion), will the unmapped read be mapped and the 70 non-mapping nucleotides just be soft-clipped in the BAM file?

    Any help would be greatly appreciated.

    Cheers,
    Kevin
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    In some cases, the source code is the best documentation. I assume you mean in "bwa sampe", so check out the "bwa_paired_sw" function. It looks like unmapped mates are rescued if the mapping quality of the other end is greater than SW_MIN_MAPQ (set to 17).

    Comment

    • kjlee
      Member
      • Jun 2011
      • 12

      #3
      I believe that I found what I was looking for. Per Nils' suggestion, I went to the source code.

      My primary query concerned the length of the match (of an unmapped read that was re-mapped using a Smith-Waterman alignment in the vicinity of a uniquely mapped read) that was required for BWA to place it.

      #define SW_MIN_MATCH_LEN 20
      #define SW_MIN_MAPQ 17
      ...
      bwa_cigar_t *bwa_sw_core(bwtint_t l_pac, const ubyte_t *pacseq, int len, const ubyte_t *seq, int64_t *beg, int reglen, int *n_cigar, uint32_t *_cnt)
      {
      ...
      // check whether there are too many N's
      if (reglen < SW_MIN_MATCH_LEN || (int64_t)l_pac - *beg < len) return 0;
      for (k = 0, x = 0; k < len; ++k)
      if (seq[k] >= 4) ++x;
      if ((float)x/len >= 0.25 || len - x < SW_MIN_MATCH_LEN) return 0;
      ...
      if (x < SW_MIN_MATCH_LEN || y < SW_MIN_MATCH_LEN) { // not good enough
      free(path); free(cigar); free(ref_seq);
      *n_cigar = 0;
      return 0;
      So basically, if there are more then 20 bases that match (in a Smith-Waterman re-alignment) the unmapped (or improperly mapped) mate will be rescued.

      Cheers.

      Comment

      • kjlee
        Member
        • Jun 2011
        • 12

        #4
        Thanks for the advice, Nils.

        Comment

        • nilshomer
          Nils Homer
          • Nov 2008
          • 1283

          #5
          It would be nice to have them as command line options to see what effect there is when varying these values.

          Comment

          • vyellapa
            Member
            • Oct 2011
            • 59

            #6
            What do anomalous pairs mean. Samtools mpileup is removing such reads(when compared to seeing these in IGV) unless -A option is added but Im not sure what it means.

            Code:
            Samtools spec says
            Added `mpileup -A' to allow to use reads in anomalous pairs in SNP calling.

            Comment

            • Michael.James.Clark
              Senior Member
              • Apr 2009
              • 207

              #7
              Originally posted by nilshomer View Post
              It would be nice to have them as command line options to see what effect there is when varying these values.
              Indeed it would be!
              Mendelian Disorder: A blogshare of random useful information for general public consumption. [Blog]
              Breakway: A Program to Identify Structural Variations in Genomic Data [Website] [Forum Post]
              Projects: U87MG whole genome sequence [Website] [Paper]

              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
              20 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-09-2026, 10:04 AM
              0 responses
              31 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-08-2026, 10:08 AM
              0 responses
              20 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...