This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bowtie2 to map multiple fastq.gz files?

Hi all, I am trying to map DNA sequences using bowtie2 for multiple paired fastq.gz files. I am using a "for loop" that worked well for my other scripts; however, this time it seems that bowtie2 does not recognize the directory paths for my files or index basename. I keep having this message "No index, query, or output file specified!". I downloaded the index files from the bowtie2 website (https://genome-idx.s3.amazonaws.com/bt/ARS-UCD1.2.zip), unzipped it, and checked with bowtie2-inspect (it works well). The *.bt2 files and my sequences are in the same INPUT_DIRECTORY. I do not know why I have that error about not finding the files. I would really appreciate any advice.

 INPUT_DIRECTORY=/mnt/home/vascokar/mastitis_study/trimmed

 module load GCC/9.3.0 Bowtie2/2.4.1 SAMtools/1.11

 cd $INPUT_DIRECTORY

  for f in *_R1_paired.fastq.gz
  do
 n=${f%%_R1_paired.fastq.gz} 

 bowtie2 –-threads 5 -x $INPUT_DIRECTORY/ARS-UCD1.2 -1 $INPUT_DIRECTORY/${n}_R1_paired.fastq.gz -2 $INPUT_DIRECTORY/${n}_R2_paired.fastq.gz -S $INPUT_DIRECTORY/${n}_R1_host_mapped_and_unmapped.sam
 done
bowtie2 for loop

Can you show us the output of following command?

ls -lh /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD*
[vascokar@dev-intel16 scripts_toy]$ ls -lh /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD*
-rw-r----- 1 vascokar epi 868M Mar  5 13:59 /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD1.2.1.bt2
-rw-r----- 1 vascokar epi 648M Mar  5 13:59 /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD1.2.2.bt2
-rw-r----- 1 vascokar epi  23K Mar  5 13:59 /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD1.2.3.bt2
-rw-r----- 1 vascokar epi 648M Mar  5 13:59 /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD1.2.4.bt2
-rw-r----- 1 vascokar epi 868M Mar  5 13:59 /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD1.2.rev.1.bt2
-rw-r----- 1 vascokar epi 648M Mar  5 13:59 /mnt/home/vascokar/mastitis_study/trimmed/ARS-UCD1.2.rev.2.bt2

1 answer

I found the problem. Instead of a hyphen "-" I had dashes "–" for my -2 and -S. Now it is working!

Log in to answer this question.