RAxML-NG

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

submit_raxml-ng.sh
#!/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

Bootstrap

submit_raxml-ng_bootstrap.sh
#!/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)

submit_raxml-ng_all.sh
#!/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

Evolution Models

Model

Description

GTR+G

General Time Reversible with gamma distribution

GTR+G4

GTR with 4 gamma categories

GTR+I+G4

GTR with invariant proportion + gamma

JC69

Jukes-Cantor 1969

HKY85

Hasegawa-Kishino-Yano 1985

TN93

Tamura-Nei 1993

K80

Kimura 2-parameter

F81

Felsenstein 1981

Job Array for Multiple Alignments

submit_raxml-ng_array.sh
#!/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

analyze_raxml-ng.sh
#!/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

See also