RAxML-NG
In this section:
Description
According to the page of RAxML-NG, RAxML-NG is a phylogenetic inference tool using the maximum likelihood (ML) optimality criterion. It is the successor to RAxML, offering improvements in speed, flexibility, and usability.
Available Versions
raxml-ng/1.0.3 (default)
Loading the Module
# Load RAxML-NG
module load raxml-ng/1.0.3
# Verify installation
raxml-ng --version
raxml-ng-mpi --version
Job Submission
#!/bin/bash
#SBATCH -J raxmlng
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 24:00:00
#SBATCH --mem=16G
export INPUT="test.fa"
export OUTPUT="test.fa.raxml.*"
module load raxml-ng/1.0.3
job-nanny raxml-ng --msa test.fa --model GTR+G --threads $SLURM_CPUS_PER_TASK
Best Tree Search
#!/bin/bash
#SBATCH -J raxmlng_search
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 48:00:00
#SBATCH --mem=32G
export INPUT="alignment.phy"
export OUTPUT="RAxMLNG_*"
module load raxml-ng/1.0.3
job-nanny raxml-ng --msa alignment.phy --model GTR+G \
--threads $SLURM_CPUS_PER_TASK \
--prefix RAxMLNG --seed 12345
Bootstrap
#!/bin/bash
#SBATCH -J raxmlng_boot
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 72:00:00
#SBATCH --mem=32G
export INPUT="alignment.phy"
export OUTPUT="RAxMLNG_*"
module load raxml-ng/1.0.3
# Bootstrap
job-nanny raxml-ng --bootstrap --msa alignment.phy --model GTR+G \
--threads $SLURM_CPUS_PER_TASK \
--prefix boot --seed 12345 --bs-trees 100
# Map bootstrap on best tree
job-nanny raxml-ng --support --tree boot.raxml.bestTree \
--bs-trees boot.raxml.bootstraps \
--prefix support --threads $SLURM_CPUS_PER_TASK
Full Analysis (Search + Bootstrap)
#!/bin/bash
#SBATCH -J raxmlng_all
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 96:00:00
#SBATCH --mem=32G
export INPUT="alignment.phy"
export OUTPUT="RAxMLNG_*"
module load raxml-ng/1.0.3
job-nanny raxml-ng --all --msa alignment.phy --model GTR+G \
--threads $SLURM_CPUS_PER_TASK \
--prefix complete --seed 12345 \
--bs-trees 100
Available Models
Model |
Description |
|---|---|
|
General Time Reversible with gamma distribution |
|
GTR with 4 gamma categories |
|
GTR with invariant proportion + gamma |
|
Jukes-Cantor 1969 |
|
Hasegawa-Kishino-Yano 1985 |
|
Tamura-Nei 1993 |
|
Kimura 2-parameter |
|
Felsenstein 1981 |
Job Array for Multiple Alignments
#!/bin/bash
#SBATCH -J raxmlng_array
#SBATCH --array=1-10
#SBATCH -N 1
#SBATCH -c 8
#SBATCH -t 48:00:00
#SBATCH --mem=32G
FILES=($(ls *.phy *.fa *.fasta))
FILE=${FILES[$SLURM_ARRAY_TASK_ID-1]}
PREFIX="raxmlng_${FILE%.*}"
export INPUT="$FILE"
export OUTPUT="${PREFIX}_*"
module load raxml-ng/1.0.3
job-nanny raxml-ng --msa $FILE --model GTR+G \
--threads $SLURM_CPUS_PER_TASK \
--prefix $PREFIX --seed 12345
Results Analysis
#!/bin/bash
#SBATCH -J analyze_raxmlng
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 01:00:00
#SBATCH --mem=4G
module load raxml-ng/1.0.3
# Check bootstrap convergence
raxml-ng --bsconvergence --bs-trees boot.raxml.bootstraps \
--prefix convergence --seed 12345
# Calculate consensus tree
raxml-ng --consense --tree boot.raxml.bootstraps \
--prefix consense --seed 12345
# Extract statistics
for f in *.raxml.log; do
echo "File: $f"
grep "Final log likelihood" $f
grep "Tree length" $f
grep "Number of distinct tree topologies" $f
echo "---"
done > stats.txt
# Generate tree PDF (requires Python with ete3)
cat > plot_tree.py << 'EOF'
from ete3 import Tree, TreeStyle
import glob
for tree_file in glob.glob("*.raxml.bestTree"):
t = Tree(tree_file)
ts = TreeStyle()
ts.show_leaf_name = True
ts.show_branch_length = True
ts.show_branch_support = True
outfile = tree_file.replace("bestTree", "tree.pdf")
t.render(outfile, tree_style=ts)
EOF
python plot_tree.py 2>/dev/null || echo "ete3 not installed"
References
Documentation: https://github.com/amkozlov/raxml-ng/wiki
Manual: https://github.com/amkozlov/raxml-ng/blob/master/README.md
Tutorial: https://github.com/amkozlov/raxml-ng/wiki/Tutorial
See also
RAxML - Previous version
BEAST - Bayesian analysis
ExaBayes - Bayesian alternative
Running Simulations - How to submit jobs