Module Bowtie2
Contents |
|---|
Interactive job
Open an interactive session to a compute node. Adjust the number of CPUs (--cpus-per-task 8) and the amount of memory (--mem 16G) needed for your job. Increasing the number of threads will speed up the index building considerably in most cases. Threads will run on separate cores and synchronize when parsing reads and outputting alignments. Searching for alignments is highly parallel, and speedup is close to linear. Increasing --threads increases Bowtie 2's memory footprint. E.g. when aligning to a human genome index, increasing --threads from 1 (default) to 8 increases the memory footprint by a few hundred megabytes.
srun --cpus-per-task 8 --mem 16G --pty bash
Load bowtie2 module.
module load bowtie2/2.5.2
Run bowtie2.
bowtie2-build --threads 8 /opt/bowtie2-2.5.2/example/reference/lambda_virus.fa lambda_virus
[user@athena1 ~]$ srun --cpus-per-task 8 --mem 16G --pty bash
[user@athena101 ~]$ module load bowtie2/2.5.2
[user@athena101 ~]$ bowtie2-build --threads 8 /opt/bowtie2-2.5.2/example/reference/lambda_virus.fa lambda_virus
Output files: "lambda_virus.*.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: 32
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:
/opt/bowtie2-2.5.2/example/reference/lambda_virus.fa
...
Batch job
Create the Slurm script file. Adjust the number of CPUs (--cpus-per-task 8) and the amount of memory (--mem 16G) needed for your job.
bowtie2_slurm_script.sh
#!/bin/bash
#SBATCH --job-name Bowtie2_job
#SBATCH --output Bowtie2_job_output.log
#SBATCH --error Bowtie2_job_error.log
#SBATCH --cpus-per-task 8
#SBATCH --mem 16G
module load bowtie2/2.5.2
bowtie2-build --threads $SLURM_CPUS_PER_TASK /opt/bowtie2-2.5.2/example/reference/lambda_virus.fa lambda_virus
Submit the job to Slurm.
sbatch bowtie2_slurm_script.shMonitor the execution of your job in the Slurm queue.
squeue -u $USERThe job may show up in the queue as running (R) or pending (PD). When the job completes, it will disappear from the queue and you can check the output.
[user@athena1 ~]$ sbatch bowtie2_slurm_script.sh
Submitted batch job 123
[user@athena1 ~]$ squeue -u $USER
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) ## Job is running with JOBID 123
123 cpu Bowtie2_job user R 0:01 1 athena101
[user@athena1 ~]$ squeue -u $USER
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) ## JOBID 123 completed and exited the queue
[user@athena1 ~]$ cat Bowtie2_job_output.log
Output files: "lambda_virus.*.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: 32
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:
/opt/bowtie2-2.5.2/example/reference/lambda_virus.fa
...