SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bowtie2 mapping and paired-end reads westeros Bioinformatics 3 03-22-2014 01:02 AM
How to count number of mapped paired-end and single-end rna-seq reads repinementer Bioinformatics 8 01-06-2013 05:06 AM
Tophat/Bowtie2 inconsistency in number of paired reads BenLerch RNA Sequencing 0 07-14-2012 11:52 AM
Bfast alignement with paired end reads in separate files david.tamborero Bioinformatics 2 11-29-2011 07:49 AM

Reply
 
Thread Tools
Old 03-19-2014, 06:20 AM   #1
jesstilla
Junior Member
 
Location: Boston

Join Date: Oct 2013
Posts: 7
Default different number of sequences in a paired end alignement with Bowtie2?

Hello,

I am very new to using Bowtie2, and would love some help!

I am hoping to do a paired end alignment. I had the same number of sequences in each file originally. First, I did a quality trim using FASTX to remove low quality sequence at the end. Then, when I try to do my paired end alignment, I get an error message saying that I had a different number of sequences in the two files. I'm guessing that perhaps one (or more) of my sequences was of a low quality all the way through and removed altogether...?

What is the best way around this problem? Is there an option in Bowtie2 to deal with an unequal number of sequences?

Thanks so much!
jesstilla is offline   Reply With Quote
Old 03-19-2014, 06:23 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Just use a different read trimmer, for example trimmomatic or trim_galore. Fastx tools are known to cause problems like this.
dpryan is offline   Reply With Quote
Old 03-19-2014, 06:33 AM   #3
westerman
Rick Westerman
 
Location: Purdue University, Indiana, USA

Join Date: Jun 2008
Posts: 1,104
Default

Quote:
Originally Posted by jesstilla View Post
What is the best way around this problem? Is there an option in Bowtie2 to deal with an unequal number of sequences?
dpryan has the correct ultimate solution -- don't use fastx directly because it destroys any pairing. However in answer to your specific question above the answer is "No, not if you want to consider your sequences as pairs." On the other hand if you wish to treat your reads as single ends then you can use the '-U' parameter to input the reads to bowtie2.
westerman is offline   Reply With Quote
Old 03-19-2014, 08:25 AM   #4
SES
Senior Member
 
Location: Vancouver, BC

Join Date: Mar 2010
Posts: 275
Default

Quote:
Originally Posted by jesstilla View Post
What is the best way around this problem? Is there an option in Bowtie2 to deal with an unequal number of sequences?
For the first question, you need to sync your read pairs and to your second question, I don't think so. The solution is to re-pair your reads and there are a number of posts on seqanswers about that topic. The other comments about using a different trimmer are ways to avoid this in the future (prinseq keeps pairs also), but that doesn't solve your current problem. Retrimming your reads with another tool because they are out of sync seems like a silly approach to me because you've already spent time trimming. Just sync your paired reads now and then you'll be able to use the read pairs and the singletons created by trimming.
SES is offline   Reply With Quote
Old 03-19-2014, 09:46 AM   #5
jesstilla
Junior Member
 
Location: Boston

Join Date: Oct 2013
Posts: 7
Default

Thanks so much for getting back to me!

I used Trimmomatic to trim my sequences, and I unfortunately had the same problem when I tried to use Bowtie2 afterward. The error message says "fewer reads in file specified with -2 than in file specified with -1 terminate called after throwing an instance of 'int' bowtie2-align died with signal 6 (ABRT) (core dumped)"

I'm not sure what I'm doing wrong, but I included the arguments I used in case anything jumps out at you.

For Trimmomatic:
bsub java -jar /cluster/tufts/dopmanlab/Jessie2/nexteraJLM/Trimmomatic-0.32/trimmomatic-0.32.jar PE -phred33 Sample_ACB5.R1.fastq Sample_ACB5.R2.fastq ACB5_trim_pairfor_prac.fastq ACB5_trim_pairrev_prac.fastq ACB5_trim_unpairfor_prac.fastq ACB5_trim_unpairrev.fastq TRAILING:30

For Bowtie2:
bsub -o <output file> -e <error file> /cluster/tufts/ngsp/ngsp/bowtie2-2.1.0/bowtie2 --very-sensitive --phred33 --no-unal -x <name of reference> -1 <forward file> -2 <reverse file> -I 300 -X 550 -S <SAM output file>

Thanks a bunch!
jesstilla is offline   Reply With Quote
Old 03-19-2014, 09:54 AM   #6
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

Hmmm.... did you check to make sure they had the same number of reads before trimming?
Brian Bushnell is offline   Reply With Quote
Old 03-19-2014, 09:55 AM   #7
jesstilla
Junior Member
 
Location: Boston

Join Date: Oct 2013
Posts: 7
Default

Well, Bowtie2 will do the alignment when I use the untrimmed files, so I assumed that there were the same number of sequences in each file...
jesstilla is offline   Reply With Quote
Old 03-19-2014, 10:06 AM   #8
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

In Linux, you can do:
wc -l Sample_ACB5.R1.fastq Sample_ACB5.R2.fastq

And it will tell you how many lines there are in each of them. But I'm not sure what you're doing with giving trimmomatic 6 files at once. I've not used it, but normally if you want a program to understand that data is paired, you can only give it 2 files at a time.
Brian Bushnell is offline   Reply With Quote
Old 03-19-2014, 10:07 AM   #9
SES
Senior Member
 
Location: Vancouver, BC

Join Date: Mar 2010
Posts: 275
Default

Quote:
Originally Posted by jesstilla View Post
Well, Bowtie2 will do the alignment when I use the untrimmed files, so I assumed that there were the same number of sequences in each file...
You are probably correct in that case, though it's odd you had a problem after trimming with a program that is aware of the paired reads. I would take the same approach as suggested above, which is check the read counts in each file before and after trimming. It may be that the command is not correct, but I'm not a trimmomatic user so I can't say. I think the best approach would probably be to check read numbers and then start investigating further.
SES is offline   Reply With Quote
Old 03-19-2014, 10:53 AM   #10
jesstilla
Junior Member
 
Location: Boston

Join Date: Oct 2013
Posts: 7
Default

I figured it out! There was a misordering of the output files in the trimmomatic script. Thanks to everyone for your help!
jesstilla is offline   Reply With Quote
Old 03-19-2014, 11:24 AM   #11
westerman
Rick Westerman
 
Location: Purdue University, Indiana, USA

Join Date: Jun 2008
Posts: 1,104
Default

Quote:
Originally Posted by Brian Bushnell View Post
In Linux, you can do:
wc -l Sample_ACB5.R1.fastq Sample_ACB5.R2.fastq

And it will tell you how many lines there are in each of them. But I'm not sure what you're doing with giving trimmomatic 6 files at once. I've not used it, but normally if you want a program to understand that data is paired, you can only give it 2 files at a time.
Brian. You *really* need to use Trimmomatic at some point. Indeed Trimmomatic requires 6 files -- two input and four output.
westerman is offline   Reply With Quote
Old 03-19-2014, 04:09 PM   #12
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

Quote:
Originally Posted by westerman View Post
Brian. You *really* need to use Trimmomatic at some point. Indeed Trimmomatic requires 6 files -- two input and four output.
Haha, silly me. I guess that makes sense. For some reason everyone at JGI uses interleaved files for everything.
Brian Bushnell 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 08:02 PM.


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