Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • efoss
    Member
    • Jul 2011
    • 98

    #1

    removing reads that map to more than one location from gsnap-aligned bam files

    I would like to remove reads that map to more than one location from bam files I created using gsnap. Does anyone know how to do this? I would prefer not to have to realign. Also, does anyone know what MAPQ 0 means in files that have been aligned using gsnap? As I understand it, the meaning of MAPQ 0 can change depending on which aligner was used to generate the bam file.

    Thanks.

    Eric
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

    #2
    see here : https://www.biostars.org/p/56246/

    samtools view -bq 1 file.bam > unique.bam

    Comment

    • efoss
      Member
      • Jul 2011
      • 98

      #3
      Fantastic! Thanks so much, Richard Finney.

      As I understand this command, it's saying to filter out anything with a mapping quality (MAPQ) score that is less than one and output that as a bam file. Is it true that, regardless of which aligner you use to create your bam file, a read that maps to more than one location will have a MAPQ score of 0?

      Comment

      • Richard Finney
        Senior Member
        • Feb 2009
        • 701

        #4
        Not necessarily.
        The tags (I think) are optional and not all alignment programs go the extra mile to make sure the tags are thorough.
        I'm not sure how orthodox GSNAP is on this matter; you may wish to view the sam output tags to make sure they're what they should be.

        Comment

        • Brian Bushnell
          Super Moderator
          • Jan 2014
          • 2709

          #5
          Typically, a read that maps to multiple locations with a similar (internal) score will get a mapq of 3 or less, as 3 indicates at most a 50% chance that a given alignment is correct. But it varies greatly by aligner; some will always give mapq 255 for any mapped read, for example.

          More importantly, even if an aligner does assign a read to multiple locations, they are not necessarily equivalent; the primary might be much better than the secondaries (and as such perhaps get a mapq well above 3). There is not a simple, universal way to ensure that you remove all reads from a sam file that map to multiple locations when processing it as a stream without tracking names to see how many times they occur, though you could make this process efficient if the file is sorted by name.

          It's trivial to filter out all secondary alignments, though, with samtools.

          Comment

          Latest Articles

          Collapse

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

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 07-24-2026, 12:17 PM
          0 responses
          10 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-23-2026, 11:41 AM
          0 responses
          11 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-20-2026, 11:10 AM
          0 responses
          23 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-13-2026, 10:26 AM
          0 responses
          37 views
          0 reactions
          Last Post SEQadmin2  
          Working...