<p>It seems you do not have bowtie installed or loaded. Use <code>module load bowtie2</code> together when you load <code>samtools</code>.</p>

CC BY-SA 4.0
2021-02-10T22:56:20.003Z
Thank you, it worked. Just a general inquiry at the end.. Is ```samtools``` really necessary here? Thanks.
Dmitrii Trubetskoy
CC BY-SA 4.0
2021-02-11T01:18:06.613Z
From your script samtools does not seem to be necessary.
Phoenix Mu
CC BY-SA 4.0
2021-02-10T21:35:10.410Z
2021-02-10T21:35:10.410Z
Phoenix Mu
<p>I am trying to run my alignment script that works locally, using <code>SBATCH</code>.</p>
<p>Official manual for <code>bowtie2</code> says I can use <code>samtools</code> for that. However when I run the following script I have an error</p>
<pre><code>line 22: bowtie2: command not found
</code></pre>
<p>Below is the script:</p>
<pre><code>#!/bin/bash

#SBATCH --time=05:00:00
#SBATCH --account=def-myaccount
#SBATCH --mem=200000M
#SBATCH --mail-user=mymail@gmail.com
#SBATCH --mail-type=All


module load nixpkgs/16.09  intel/2018.3
module load samtools/1.9



for FILE in *R1_001.fastq.gz;

do
        BASENAME=${file%%_R1_001.fastq.gz*}

        NUM=`echo $FILE | sed 's/_S.*$//'`

        bowtie2 -x cov_nastya -U <span class="math-container">$FILE -S $</span>{NUM}exit.sam

done
</code></pre>

<samtools><bowtie2><slurm>
How to perform bowtie2 analysis with slurm?
# How to perform bowtie2 analysis with slurm?

(Asked by: username_0 on 2021-02-10)

I am trying to run my alignment script that works locally, using SBATCH.
Official manual for bowtie2 says I can use samtools for that. However when I run the following script I have an error
line 22: bowtie2: command not found

Below is the script:
#!/bin/bash

#SBATCH --time=05:00:00
#SBATCH --account=def-myaccount
#SBATCH --mem=200000M
#SBATCH --mail-user=mymail@gmail.com
#SBATCH --mail-type=All


module load nixpkgs/16.09  intel/2018.3
module load samtools/1.9



for FILE in *R1_001.fastq.gz;

do
        BASENAME=${file%%_R1_001.fastq.gz*}

        NUM=`echo $FILE | sed 's/_S.*$//'`

        bowtie2 -x cov_nastya -U $FILE -S ${NUM}exit.sam

done

**Tags:** samtools, bowtie2, slurm

---

## 1 answers

### Answer by username_1 on 2021-02-10. Score: 3 | Accepted answer

It seems you do not have bowtie installed or loaded. Use `module load bowtie2` together when you load `samtools`.

> **Comments:**
> **username_0**: Thank you, it worked. Just a general inquiry at the end.. Is ```samtools``` really necessary here? Thanks.  
> **username_1**: From your script samtools does not seem to be necessary.  

---

