MAFFT
Official website : https://mafft.cbrc.jp/alignment/software/
Available version
version | module |
---|---|
7.505 | MAFFT/7.505-cpeGNU-23.03-with-extensions |
Job submission script
multithreads (1 node)
#!/bin/bash
#SBATCH -p compute # specific partition (compute,memory)
#SBATCH -N 1 -c 16 # -N 1 must be 1, -c can be 16, 32, 64, 128 depending on the requirement
#SBATCH -t 02:00:00 # job time limit <hr:min:sec>
#SBATCH -A lt200xxx # project ID
#SBATCH -J MAFFT # job name
module restore
module load MAFFT/7.505-cpeGNU-23.03-with-extensions
#Set TMPDIR location, uncomment and modify projectID-shortname
#mkdir -p /scratch/lt200xxx-abcdef/$USER/$SLURM_JOB_ID
#export MAFFT_TMPDIR=/scratch/lt200xxx-abcdef/$USER/$SLURM_JOB_ID
mafft --thread $SLURM_CPUS_PER_TASK --threadtb 16 --threadit 16 input.fasta > aligned.fasta
The usage of -- large
option
Using the --large option reduces RAM usage, as the program stores data in temporary files instead. Using this function helps mitigate issues of running out of memory (out of memory), but it may result in slower computational performance.
Setting temporary file directory (TMPDIR)
Normally, temporary files are stored in $HOME/maffttmp/
. Users can change the storage location by configuring MAFFT_TMPDIR
to the desired path.
If temporary files become too large, it may result in an error: 'disk quota exceed.'
If you intend to use --large
option, the team recommends setting MAFFT_TMPDIR to a location with a sufficient disk quota, such as a project home or scratch directory.
MPI (> 1 nodes)
For more details, please see https://mafft.cbrc.jp/alignment/software/mpi.html.
#!/bin/bash
#SBATCH -p memory # specific partition (compute,memory)
#SBATCH -N 2 --ntasks-per-node=1 -c 128 # specify computing resources ( 2 nodes, 1 task per node, 128 threads per task)
#SBATCH -t 02:00:00 # job time limit <hr:min:sec>
#SBATCH -A lt200xxx # project name
#SBATCH -J MAFFT128-mpi # job name
module restore
module load MAFFT/7.505-cpeGNU-23.03-with-extensions
# set enviroment variable according to https://mafft.cbrc.jp/alignment/software/mpi.html
export MAFFT_MPIRUN="srun"
export MAFFT_N_THREADS_PER_PROCESS="128"
#Set TMPDIR location, uncomment and modify projectID-shortname
#mkdir -p /scratch/lt200xxx-abcdef/$USER/$SLURM_JOB_ID
#export MAFFT_TMPDIR=/scratch/lt200xxx-abcdef/$USER/$SLURM_JOB_ID
# Run the script to be monitored
mafft --mpi --large --thread $SLURM_CPUS_PER_TASK input.fasta > aligned.fasta