This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error: Encountered internal Bowtie 2 exception (#1)

Hey guys,

I need your help urgently! I am really sorry for bothering your time. The Job script I have written below:

#!/bin/bash
#$ -pe smp 16
#$ -l h_vmem=6G
#$ -l h_rt=72:0:0
#$ -cwd
#$ -j y
#$ -N bt22866_mapping
module load bowtie2
bowtie2-build /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.fa \
          /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg
bowtie2 --very-fast-local -x /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg \
                      -1 /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/input/reads_for_mapping.R1.fq.gz \
                      -2 /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/input/reads_for_mapping.R2.fq.gz > /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/tmp/alignments/aligned_draft_reads.sam

have managed to produce this type of error:

Output files: "/data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.*.bt2"
  Line rate: 6 (line is 64 bytes)
  Lines per side: 1 (side is 64 bytes)
  Offset rate: 4 (one in 16)
  FTable chars: 10
  Strings: unpacked
  Max bucket size: default
  Max bucket size, sqrt multiplier: default
  Max bucket size, len divisor: 4
  Difference-cover sample period: 1024
  Endianness: little
  Actual local endianness: little
  Sanity checking: disabled
  Assertions: disabled
  Random seed: 0
  Sizeofs: void*:8, int:4, long:8, size_t:8
Input files DNA, FASTA:
  /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.fa
  Mapping_script.sh
Building a SMALL index
Reading reference sizes
Warning: Encountered empty reference sequence
  Time reading reference sizes: 00:00:02
Calculating joined length
Writing header
Reserving space for joined string
Joining reference sequences
Reference file does not seem to be a FASTA file
  Time to join reference sequences: 00:00:03
Total time for call to driver() for forward index: 00:00:05
Error: Encountered internal Bowtie 2 exception (#1)
Command: /share/apps/centos7/bowtie2/gcc/8.2.0/2.4.5/bin/bowtie2-build-s --wrapper basic-0 /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.fa,Mapping_script.sh /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg
Deleting "/data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.3.bt2" file written during aborted indexing attempt.
Deleting "/data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.4.bt2" file written during aborted indexing attempt.
Deleting "/data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.1.bt2" file written during aborted indexing attempt.
Deleting "/data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg.2.bt2" file written during aborted indexing attempt.
[bt22866@frontend8 Mapping_script]$
[bt22866@frontend8 Mapping_script]$ bowtie2 --very-fast-local -x /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg \
> Mapping_script.sh                   -1 /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/input/reads_for_mapping.R1.fq.gz \
> Mapping_script.sh                   -2 /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/input/reads_for_mapping.R2.fq.gz > /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/tmp/alignments/aligned_draft_reads.sam
Use of uninitialized value in pattern match (m//) at /share/apps/centos7/bowtie2/gcc/8.2.0/2.4.5/bin/bowtie2 line 335.
Use of uninitialized value in pattern match (m//) at /share/apps/centos7/bowtie2/gcc/8.2.0/2.4.5/bin/bowtie2 line 335.
Use of uninitialized value $mate2s[1] in join or string at /share/apps/centos7/bowtie2/gcc/8.2.0/2.4.5/bin/bowtie2 line 407.
Error: 2 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: /share/apps/centos7/bowtie2/gcc/8.2.0/2.4.5/bin/bowtie2-align-s --wrapper basic-0 --very-fast-local -x /data/home/bt22866/2022-10-09_Genome_assembly_BIO726P/tmp/draft_results.ctg -1 /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/input/reads_for_mapping.R1.fq.gz,Mapping_script.sh -2 /data/home/bt22866/2022-10-12_Genome_Mapping_BIO726P/input/reads_for_mapping.R2.fq.gz, Mapping_script.sh
(ERR): bowtie2-align exited with value 1

I have checked the assembly file and everything looks fine. However, it still kept producing this error. Could someone help me identify the mistake and resolve it? Additionally, is there any way I can run the job at a faster pace after I have submitted the job script?

bowtie2

1 answer

Additionally, is there any way I can run the job at a faster pace after I have submitted the job script?

No but you can do this before submitting the job by specifying more cores/CPUs to use with your bowtie2 command with -p option. You will need to request a corresponding number of cores from your job scheduler with the appropriate option. Ask for additional memory as well.

Error: 2 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.

I think the problem here is the use of a - in your directory path. bowtie2 is trying to parse that path and is having issues. In general it is not a good idea to use - in paths since - is used by programs to specify command line options.

To get around this issue change the - to an _ (underscore) in your directory names.

Change

2022-10-12_Genome_Mapping_BIO726P

to

2022_10_12_Genome_Mapping_BIO726P

Log in to answer this question.