Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chrys
    Junior Member
    • Sep 2016
    • 2

    #1

    How can I filter out reference sequences that get multiple hits in BWA MEM ?

    Hi everyone !

    I have exported a small number (~500) of 145 pb sequences from a Stacks analyse.

    I then used it as my "reference genome" (actually a very fragmented and unordered one, consequently !) to align a .fastq.gz file containing several millions of reads 1. My objective is to filter out, from my "reference", every single 145 pb sequence from which an aligned read actually has multiple hits.

    e.g if a given read has a primary alignment on Seq A from reference, but also a secondary alignment on Seq B from reference, I want to filter out both Seq A and B. In the end, I hope to obtain a smaller "reference" with very specific sequences that I can amplify unambiguously by PCR.

    I used BWA MEM to do the alignment, with parameters -a and -M turned on, but I would like to know if there would be another way (than making a script that works directly on the SAM file) to detect all sequences that I want to get rid of.

    This document about SAM format and SAMtools manual are both very helpful, and I have read a lot of threads on forums including this one but I couldn't find any solution for my issue. Would somebody have any suggestion :-) ?

    Thanks a lot !

    Chrys
  • HESmith
    Senior Member
    • Oct 2009
    • 512

    #2
    Point of clarification: assuming that your reads are shorter than 145bp, some of your reads may uniquely match a portion of reference read 'A' while other reads multi-map to references 'A' plus 'B'. Do you want to keep or discard reference 'A'?

    Comment

    • Chrys
      Junior Member
      • Sep 2016
      • 2

      #3
      Hello and thank you so much for answering me !

      In this case, I would discard reference A. Indeed my ultimate goal is to avoid as much as possible cross amplification when performing PCR, and to avoid the risk to pick up a reference that has a portion highly similar to another.

      I know this is not very subtle, but I'm still discovering sequence alignment and I want to start on an easy level

      Comment

      • HESmith
        Senior Member
        • Oct 2009
        • 512

        #4
        The simplest approach is probably to output the multi-mapping reads using SAMtools 'view' to filter (an explanation of SAM flags can be found here), then use BEDtools 'intersect -v' to output the reference elements that are not contained in your multi-mapper BAM.

        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
        19 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, Yesterday, 10:48 AM
        0 responses
        18 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        36 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...