Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • anurupa
    Member
    • Jan 2012
    • 14

    how to get uniquely aligned reads from bowtie

    hi
    i have rum bowtie 2 using —very-sensitive option and got result like this

    Code:
    14559177 reads; of these:
      14559177 (100.00%) were unpaired; of these:
        4317487 (29.65%) aligned 0 times
        7816644 (53.69%) aligned exactly 1 time
        2425046 (16.66%) aligned >1 times
    70.35% overall alignment rate
    i just want to get the uniquely aligned reads alone i,e., 53.69% of reads (78126644). but my output file (sam format) seems to have the those which are aligned>1 times how to get rid of them?

    in previous versions of bowtie i use to use -m option for that
  • danielr
    Member
    • Sep 2009
    • 11

    #2
    Filter based on having the same read name (1st column) at multiple rows, or based on the mapping quality (5th column).

    Comment

    • lindylou
      Junior Member
      • Oct 2008
      • 4

      #3
      filter on the 5th column, only retain reads with a q score of 255. This is the score given to all reads that are uniquely mappable. If you have bam files you can use

      samtools view -q 255 your.bam > your_filtered.sam

      Comment

      • MGineste
        Member
        • Feb 2011
        • 21

        #4
        Originally posted by anurupa View Post
        hi
        i have rum bowtie 2 using —very-sensitive option

        i just want to get the uniquely aligned reads alone i,e., 53.69% of reads (78126644). but my output file (sam format) seems to have the those which are aligned>1 times how to get rid of them?

        in previous versions of bowtie i use to use -m option for that
        Bonjour anurupa,

        I'm encountering the same trouble following switching from bowtie1 to bowtie2. Did you find out a satisfying solution ?

        I'm not sure that a filtering based on MAPQ using [samtools view -q] gives the desired result, as a condition for "uniqueness" for a given read is that its MAPQ is high on the best mapped position AND "much" higher than in any other mapped position.

        Mathieu

        Comment

        • MGineste
          Member
          • Feb 2011
          • 21

          #5
          Bowtie2 must somehow define what is a unique alignment (may it be related to the MAPQ or not). This definition remains unclear to me.

          Mathieu

          Comment

          • MGineste
            Member
            • Feb 2011
            • 21

            #6
            SAM files created by bowtie contains a 'XS:' tag for reporting secondary alignments for a given read.

            You can check that the number of lines containing the 'XS:' tag corresponds to the number of reads showing >1 alignment(s) :
            Code:
            grep 'XS:' your_alignment_file.sam | wc -l
            A working solution consists in removing the lines containing the ':XS' tag using sed :
            Code:
            sed '/XS:/d' your_alignment_file.sam > your_alignment_file_1alignmentonly.sam
            (Thanks go to Christelle, our group's everyday-very-valuable bioinformatician...).

            Comment

            • anurupa
              Member
              • Jan 2012
              • 14

              #7
              you are correct MGineste. I have filtered my reads by
              Code:
               grep -v XS:i: my file>output

              Comment

              • chefarov
                Junior Member
                • Oct 2014
                • 2

                #8
                Removing the lines with "XS:" will leave the corresponding headers behind, which could create a problem to SAM/BAM viewers. That happened in my case.

                Comment

                Latest Articles

                Collapse

                • SEQadmin2
                  From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                  by SEQadmin2


                  Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                  The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                  ...
                  06-02-2026, 10:05 AM
                • SEQadmin2
                  Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
                  by SEQadmin2


                  With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


                  Introduction

                  Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
                  05-22-2026, 06:42 AM
                • SEQadmin2
                  Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
                  by SEQadmin2

                  Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


                  Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
                  05-06-2026, 09:04 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, Today, 08:59 AM
                0 responses
                10 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-02-2026, 12:03 PM
                0 responses
                21 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-02-2026, 11:40 AM
                0 responses
                17 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 05-28-2026, 11:40 AM
                0 responses
                31 views
                0 reactions
                Last Post SEQadmin2  
                Working...