Bowtie2: Mate file error & internal exception
1
0
Entering edit mode
10 months ago
stefan • 0

Hello, I am a bachelor student (biomedical sciences). We are doing a Illumina sequencing task to find out a subjects heritage. Currently, I am struggling with our alignment step and I can't manage to find the answer anywhere. This is my code:

bowtie2 --threads 10  -x Reference/Bowtie2/homosapiens  -1 trimOutput/lc_good_1.fastq  -2 trimOutput/lc_good_2.fastq -S  > alignmentOutput/lc.bowtie.sam

And the error messages:

 Error: 0 mate files/sequences were specified with -1, but 1
mate files/sequences were specified with -2.  The same number of mate files/
sequences must be specified with -1 and -2.
Error: Encountered internal Bowtie 2 exception (#1)
Command: /cm/shared/apps/bowtie2/2.4.2/bin/../src/bowtie2-2.4.2/bowtie2-align-s --wrapper basic-0 --threads 10 -x Reference/Bowtie2/homosapiens -S -1 -2 trimOutput/lc_good_2.fastq trimOutput/lc_good_1.fastq
(ERR): bowtie2-align exited with value 1

I have read the bowtie2 -help page a hunder times but can't seem to find the solution. Any help is much appreciated!

This is the first time I'm working with a programming language so use simple words in your response :)

alignment next-gen sequence • 473 views
ADD COMMENT
0
Entering edit mode
10 months ago
GenoMax 111k

Can you try

bowtie2 --threads 10  -x Reference/Bowtie2/homosapiens  -1 trimOutput/lc_good_1.fastq  -2 trimOutput/lc_good_2.fastq -S  alignmentOutput/lc.bowtie.sam

There is no need to use a > before a file name.

You can actually pipe the output directly to samtools and omit making SAM format file altogether. This saves space.

bowtie2 --threads 10  -x Reference/Bowtie2/homosapiens  -1 trimOutput/lc_good_1.fastq  -2 trimOutput/lc_good_2.fastq  | samtools sort -o alignment.bam -
ADD COMMENT
0
Entering edit mode

I tried

bowtie2 --threads 10  -x Reference/Bowtie2/homosapiens  -1 trimOutput/lc_good_1.fastq  -2 trimOutput/lc_good_2.fastq -S  alignmentOutput/lc.bowtie.sam

and still got

Error reading _ebwt[] array: no more data
Error: Encountered internal Bowtie 2 exception (#1)
Command: /cm/shared/apps/bowtie2/2.4.2/bin/../src/bowtie2-2.4.2/bowtie2-align-s --wrapper basic-0 --threads 10 -x Reference/Bowtie2/homosapiens -S alignmentOutput/lc.bowtie.sam -1 trimOutput/lc_good_1.fastq -2 trimOutput/lc_good_2.fastq
(ERR): bowtie2-align exited with value 1

Tried

bowtie2 --threads 10  -x Reference/Bowtie2/homosapiens  -1 trimOutput/lc_good_1.fastq  -2 trimOutput/lc_good_2.fastq  | samtools sort -o alignment.bam -

And got

Error reading _ebwt[] array: no more data
Error: Encountered internal Bowtie 2 exception (#1)
Command: /cm/shared/apps/bowtie2/2.4.2/bin/../src/bowtie2-2.4.2/bowtie2-align-s --wrapper basic-0 --threads 10 -x Reference/Bowtie2/homosapiens -1 trimOutput/lc_good_1.fastq -2 trimOutput/lc_good_2.fastq
(ERR): bowtie2-align exited with value 1
samtools sort: failed to read header from "-"

Also tried without the "-" at the end of the command, but didn't change anything.

ADD REPLY
0
Entering edit mode

For your reference genome -x Reference/Bowtie2/homosapiens homosapiens is a directory or the basename of your index file? In the directory Reference/Bowtie2 you have files name homosapiens.1.bt2 homosapiens.2.bt2 etc?

ADD REPLY
0
Entering edit mode

It is the basename, see the answer to GenoMax below

ADD REPLY
0
Entering edit mode

It is the basename, see the answer to GenoMax below

ADD REPLY
0
Entering edit mode

Can you post the output of ls -l Reference/Bowtie2/homosapiens? As @quentin54520 says you are likely not using the basename of your bowtie2 index files.

ADD REPLY
0
Entering edit mode
    [student@beowulf ~]$ ls Reference/Bowtie2/
homosapiens.1.bt2  homosapiens.2.bt2  homosapiens.3.bt2  homosapiens.4.bt2  homosapiens.rev.1.bt2  homosapiens.rev.2.bt2

As you can see it is a basename of my index file. The bowtie2 manual said I should remove the trailing (.X.bt2) which I think I did by referencing the index with Reference/Bowtie2/homosapiens

[student@beowulf ~]$ ls -l Reference/Bowtie2/homosapiens
ls: cannot access Reference/Bowtie2/homosapiens: No such file or directory

the ls -l gives me a an error. Probably because using ls -l does not specify any of the 6 files that are in the bowtie2 directory.

ADD REPLY
0
Entering edit mode

Did you create this index yourself? Generally one needs to have at least a softlink (if not the full file) for the genome multi-fasta file in the directory where the index files are present. Your genome file must have been called homosapiens.fa? Make sure there is a softlink or a copy in index directory and try again.

BTW: ls -l Reference/Bowtie2/homosapiens* should work. I forgot the wildcard before.

ADD REPLY
0
Entering edit mode

I did not create the index myself, my teacher did. I'll ask him whether this might be the problem. As for now, I switched to bowtie2 version 2.2.6. which seems to work. Unfortunately, adding CPUs with --thread or -p does not work in this version for me. I have decided to switch to using BWA alignment.

ADD REPLY
0
Entering edit mode

Have you trimmed the files independently? Maybe you are facing this error cause you have different amount of reads in R1 and R2

ADD REPLY
0
Entering edit mode

I have not trimmed the files seperately. This is what i used for trimming:

prinseq-lite -out_good trimOutput/lc_good -out_bad trim_output/lc_bad -fastq fastq/WGS/WGS7_S1_L001_R1_001.fastq -fastq2 fastq/WGS/WGS7_S1_L001_R2_001.fastq  -trim_right 1 -max_gc 95 -min_len 90 -trim_qual_type mean -trim_qual_window 8 -trim_qual_right 35 -trim_qual_left 35

When doing a fastqc of the trimmed files, i see that both have 506 316 sequences. So there is no difference in reads of R1 and R2

ADD REPLY

Login before adding your answer.

Traffic: 1962 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6