Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jesstilla
    Junior Member
    • Oct 2013
    • 7

    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!
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Just use a different read trimmer, for example trimmomatic or trim_galore. Fastx tools are known to cause problems like this.

    Comment

    • westerman
      Rick Westerman
      • Jun 2008
      • 1104

      #3
      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.

      Comment

      • SES
        Senior Member
        • Mar 2010
        • 275

        #4
        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.

        Comment

        • jesstilla
          Junior Member
          • Oct 2013
          • 7

          #5
          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!

          Comment

          • Brian Bushnell
            Super Moderator
            • Jan 2014
            • 2709

            #6
            Hmmm.... did you check to make sure they had the same number of reads before trimming?

            Comment

            • jesstilla
              Junior Member
              • Oct 2013
              • 7

              #7
              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...

              Comment

              • Brian Bushnell
                Super Moderator
                • Jan 2014
                • 2709

                #8
                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.

                Comment

                • SES
                  Senior Member
                  • Mar 2010
                  • 275

                  #9
                  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.

                  Comment

                  • jesstilla
                    Junior Member
                    • Oct 2013
                    • 7

                    #10
                    I figured it out! There was a misordering of the output files in the trimmomatic script. Thanks to everyone for your help!

                    Comment

                    • westerman
                      Rick Westerman
                      • Jun 2008
                      • 1104

                      #11
                      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.

                      Comment

                      • Brian Bushnell
                        Super Moderator
                        • Jan 2014
                        • 2709

                        #12
                        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.

                        Comment

                        Latest Articles

                        Collapse

                        • SEQadmin2
                          Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                          by SEQadmin2


                          I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.


                          Here are nine questions we think about, in roughly the order they matter, before...
                          06-18-2026, 07:11 AM
                        • 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

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by SEQadmin2, 06-17-2026, 06:09 AM
                        0 responses
                        21 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 06-09-2026, 11:58 AM
                        0 responses
                        38 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 06-05-2026, 10:09 AM
                        0 responses
                        45 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 06-04-2026, 08:59 AM
                        0 responses
                        49 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...