bwa-mem2

Overview

bwa-mem2 bwa-mem2 is the next version of the bwa-mem algorithm in bwa. It produces alignment identical to bwa and is ~1.3-3.1x faster depending on the use-case, dataset and the running machine.

Version 2.2.1 is installed on the CSF.

Restrictions on use

There are no restrictions on accessing the software on the CSF. It is distributed under the open source MIT License, all usage must adhere to that license.

Set up procedure

We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job inherit these settings.

Load one of the following modulefiles:

module load apps/binapps/bwa-mem2/2.2.1

Running the application

Please do not run bwa-mem2 on the login node. Jobs should be submitted to the compute nodes via batch.

You may run the following to obtain help on the command-line flags:

module load apps/binapps/bwa-mem2/2.2.1
./bwa-mem2

Indexing

# Indexing the reference sequence (Requires 28N GB memory where N is the size of the reference sequence).

./bwa-mem2 index [-p prefix] in.fasta
# Where in.fasta is the path to reference sequence fasta file and prefix is the prefix of the names of the files that store the resultant index. Default is in.fasta.

Mapping

# Run "./bwa-mem2 mem" to get all options

./bwa-mem2 mem -t $NSLOTS prefix> reads.fq/fa > out.sam
# Where prefix is the prefix specified when creating the index or the path to the reference fasta file in case no prefix was provided.

Serial batch job submission

Create a batch submission script (which will load the modulefile in the jobscript), for example:

#!/bin/bash --login
#$ -cwd             # Job will run from the current directory
### You may need to add a high memory flag here (see above)

# Choose your required version
module load apps/binapps/bwa-mem2/2.2.1
./bwa-mem2 mem prefix reads.fq/fa > out.sam

# Where prefix is the prefix specified when creating the index or the path to the reference fasta file in case no prefix was provided.

Submit the jobscript using:

qsub scriptname

where scriptname is the name of your jobscript.

If you need more RAM (memory) to complete the analysis successfully, and you may well do!, please add the flags mentioned at the high-memory jobs page for more information.

Parallel batch job submission

Create a batch submission script (which will load the modulefile in the jobscript), for example:

#!/bin/bash --login
#$ -cwd             # Job will run from the current directory
#$ -pe smp.pe 16    # Number of cores, can be 2--32
### You may need to add a high memory flag here (see above)

# Choose your required version
module load apps/binapps/bwa-mem2/2.2.1

# $NSLOTS is automatically set to the number of cores requested above
./bwa-mem2 mem -t $NSLOTS prefix reads.fq/fa > out.sam


# Where prefix is the prefix specified when creating the index or the path to the reference fasta file in case no prefix was provided.

Submit the jobscript using:

qsub scriptname

where scriptname is the name of your jobscript.

If you need more RAM (memory) to complete the analysis successfully, and you may well do!, please add the flags mentioned at the high-memory jobs page for more information.

Further info

Updates

None.

Last modified on April 29, 2022 at 11:53 am by Chris Grave