Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to report only 1 hit read by bowtie2? zhouzaiwei Bioinformatics 2 09-10-2013 09:39 PM
SAM alignment result: match without reference report finfin General 0 07-23-2012 07:07 AM 26% of my sequences match the tag NNNNNNNNNNNN john1923 Bioinformatics 0 07-29-2011 06:42 AM

Thread Tools
Old 03-03-2015, 07:47 AM   #21
Devon Ryan
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480

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.
dpryan is offline   Reply With Quote
Old 03-03-2015, 07:36 PM   #22
Location: lucknow

Join Date: Dec 2013
Posts: 13

Thank you @devon
am@i is offline   Reply With Quote
Old 03-04-2015, 02:03 AM   #23
Junior Member
Location: Bonn, Germany

Join Date: Mar 2015
Posts: 3

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.
JPOeyen is offline   Reply With Quote
Old 03-30-2017, 07:01 PM   #24
Junior Member
Location: Mexico City

Join Date: Jan 2012
Posts: 8

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.
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 at 07:18 PM.
keo is offline   Reply With Quote

bowtie2, unique reads, xs tag

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 11:15 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO