SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bowtie2 is unable to align query sequences that contain an intervening stretch of N's quokka Bioinformatics 2 10-03-2013 12:18 PM
Tophat2 can't find Bowtie2 rnavon Bioinformatics 5 02-27-2013 06:51 AM
Bowtie2 chokes on -a flag? kgulukota Bioinformatics 3 02-09-2012 09:20 AM
Sam Flag 65 and 129 after BWA Tomi Bioinformatics 3 10-05-2011 12:13 PM
Flag=4 in SAM Rachelly Bioinformatics 2 12-22-2010 02:54 AM

Reply
 
Thread Tools
Old 10-16-2013, 05:27 PM   #1
yekwah
Junior Member
 
Location: Melbourne, Victoria

Join Date: Apr 2013
Posts: 6
Default Unable to find flag in SAM with bowtie2 - but can with BWA

I'm currently using Bowtie2 to map my reads to a small region of a genome to find what region it's in by collecting the unmapped pairs of the reads which have mapped.

I'm currently using samtools flags to get the reads I want:

---a--- ......... -------------
|------------------------gene----------------|
-------..............----b-----
What we want is
a: retain unmapped reads whose mate is on reverse strand (-f 36)
b: retain unmapped reads (-f 4) excluding reads whose mate is on reverse strand or unmapped (-F 40)

samtools view -Sb -f 36 sam > NtermBam
samtools view -Sb -f 4 -F 40 sam > CtermBam

Previously when mapping with BWA both of these commands would work and I would get an N terminus bam and a C terminus bam. However, when I map with Bowtie2 (because the mapping itself is better), I get no reads in the N terminus bam and all the reads go to the C terminus bam.

Does anyone know why this might be? I'm pretty sure the samtools commands are right because it works with BWA. I'm thinking it has something to do with Bowtie2, maybe not recording flags correctly?
yekwah is offline   Reply With Quote
Old 10-17-2013, 12:26 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

A couple points. Firstly, what was the exact bowtie2 command that you specified? Depending on the flags you used, the unmapped reads may or may not even be included. Secondly, I hope you take the orientation of your genes into account when you start calling the files Nterm and Cterm. They'll be swapped if the gene is on the - strand.

BTW, the most straight forward solution is to just find a couple reads like this from the bwa alignment and use grep to see what bowtie2 did with them. Presuming they map the same, you'll then know if bowtie2 is doing something unexpected with the flags.
dpryan is offline   Reply With Quote
Old 10-17-2013, 04:03 PM   #3
yekwah
Junior Member
 
Location: Melbourne, Victoria

Join Date: Apr 2013
Posts: 6
Default

The bowtie2 commands I specified were these:

bowtie2-build ref base_name
bowtie2 --sensitive-local -x base_name -1 fq1 -2 fq2 -S sam

I'm aware that Nterm and Cterm have particular meanings, I'm just not too worried about it at this point. Once I get past this section in my testing I'll make sure the orientation is taken into account.
yekwah is offline   Reply With Quote
Old 10-18-2013, 08:20 AM   #4
westerman
Rick Westerman
 
Location: Purdue University, Indiana, USA

Join Date: Jun 2008
Posts: 1,104
Default

Quote:
Originally Posted by dpryan View Post
BTW, the most straight forward solution is to just find a couple reads like this from the bwa alignment and use grep to see what bowtie2 did with them. Presuming they map the same, you'll then know if bowtie2 is doing something unexpected with the flags.
I agree with dpryan -- get a couple of reads that you like from BWA and see what Bowtie2 did with them. The sam/bam format is flexible enough to allow programs to have different opinions on what flags are appropriate. As an aside BWA and Bowtie2 will report different template lengths (column 9) for the same mappings which just shows how 'flexible' (or ill-defined) the sam/bam format is.
westerman is offline   Reply With Quote
Reply

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 05:14 AM.


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