Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #16
    Good to know, thanks!

    Comment

    • am@i
      Member
      • Dec 2013
      • 13

      #17
      Hello,
      I find the XS tag filtering the aligned discordantly 1 time reads.

      Thanks
      Amrita

      Comment

      • JPOeyen
        Junior Member
        • Mar 2015
        • 3

        #18
        Hi all,
        I am having similar problems filtering my bowtie2 output, although not as severe as the originally reported numbers. I mapped reads back to a denovo assembled transcriptome with the following settings

        -all --end-to-end --score-min L,-0.1,-0.1 --no-discordant --no-mixed
        and got the following bowtie2 std output

        44223325 reads; of these:
        44223325 (100.00%) were paired; of these:
        7691237 (17.39%) aligned concordantly 0 times
        25521175 (57.71%) aligned concordantly exactly 1 time
        11010913 (24.90%) aligned concordantly >1 times
        82.61% overall alignment rate
        I was able to confirm the number of reads which did map concordantly exactly 0 time by searching for the 'YT:Z:UP' tag. However, when I look for reads which are mapped concordantly exactly 1 time I get a number (25,531,318) which is about 100,000 higher than the number reported by bowtie2. I counted all lines in the .sam file where the 'XS:i' and 'YT:Z:UP' tags are not present. The number does not change if I include the presence of the 'AS:i' tag.

        I am aware that the --all setting leaves the MAPQ without much meaning, so using this to filter out uniquely mapped reads is not possible. I could redo the analysis to avoid this problem, but would rather continue working with the same dataset to keep things consistent There are no mentions of this setting causing any other problems though.

        Is there something I am missing, or did my settings do something unexpected?

        Best,
        Jan Philip

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #19
          The presence of an XS auxiliary tag doesn't mean that an alignment isn't unique (n.b., "unique" isn't really a useful term, there's a reason for MAPQ scores). bowtie2 should only count an alignment as not unique if the XS and AS scores are the same.

          Note that you're typically best off simply filtering by MAPQ score.

          Comment

          • JPOeyen
            Junior Member
            • Mar 2015
            • 3

            #20
            Thank you for the swift reply. I however do not fully understand how uniqueness is defined, if not by the fact that a given read only maps to one location (given the set score thresholds etc). I understand that if the first location a read maps to is significantly better than the alternate locations (by MAPQ score feks) it could probably also be considered unique in some respect.

            However, if it is true that uniquely mapped reads could also have a XS tag, I would have expected the number of reads without it to be significantly lower, not higher, than the number reported by bowtie. So I am still pretty puzzled by my results.

            I will try to have a look at your posts regarding the MAPQ scores and seriously consider redoing my analyses.

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #21
              Therein lies the problem, there is no single definition of "uniqueness". There are multiple incompatible definitions. Further, if we relax the --score-min settings enough then by some definitions there will never be any unique alignments. This is why MAPQ is a generally more useful concept and you'd be better served just forgetting about the term "unique" in this context.

              Comment

              • am@i
                Member
                • Dec 2013
                • 13

                #22
                Thank you @devon

                Comment

                • JPOeyen
                  Junior Member
                  • Mar 2015
                  • 3

                  #23
                  Thanks for the help, I will try to figure out how to best solve the issue for my experiments.

                  I found this, which might be of interest to others trying to understand how bowtie2 assigns scores: link. There are also some interesting thoughts on uniqueness discussed in this and an older blog post.

                  Comment

                  • keo
                    Junior Member
                    • Jan 2012
                    • 8

                    #24
                    Hi all,
                    This worked for me, but I don't know if it is a general solution. If you set the -k paramenter in Bowtie2 to >=2, you should have at least twice the name of the read in your SAM file. You can use that to remove reads that appear >1 times in the file my_filename.sam. This way you don't have to undertand how Bowtie sets tags and flags.
                    prefix="my_filename"
                    tail -n +$(expr $(grep "^@" "$prefix.sam" | wc -l | cut -f 1 -d " ") + 1) "$prefix.sam" | sort | cut -f 1 | uniq -cd | cut -d " " -f 8 > "$prefix.toremove"
                    grep -vwF -f "$prefix.toremove" "$prefix.sam" > "$prefix.unique.sam"
                    rm "$prefix.toremove"
                    Comments appreciated.
                    Last edited by keo; 03-30-2017, 07:18 PM.

                    Comment

                    • chefarov
                      Junior Member
                      • Oct 2014
                      • 2

                      #25
                      Originally posted by dpryan View Post
                      The presence of an XS auxiliary tag doesn't mean that an alignment isn't unique (n.b., "unique" isn't really a useful term, there's a reason for MAPQ scores). bowtie2 should only count an alignment as not unique if the XS and AS scores are the same.

                      Note that you're typically best off simply filtering by MAPQ score.
                      How would you filter with MAPQ score? I have rows with
                      MAPQ=39 ... AS:i:0 XS:i:0

                      39 seems like an arbitrary value. In my case, The lines that don't have XS score, have a score of 42.

                      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, Today, 10:26 AM
                      0 responses
                      10 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 07-09-2026, 10:04 AM
                      0 responses
                      25 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 07-08-2026, 10:08 AM
                      0 responses
                      16 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 07-07-2026, 11:05 AM
                      0 responses
                      33 views
                      0 reactions
                      Last Post SEQadmin2  
                      Working...