Image size: 1.5 GB

For more on pulling from the registry, see the ilifu documentation.

First, once: add the registry and make it your default

singularity remote add --no-login idia-registry https://sregistry.idia.ac.za
singularity remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

singularity remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

singularity pull library://bioinformatics/beast:10.5.0

Shell into the container

singularity shell library://bioinformatics/beast:10.5.0

Run the container

singularity run library://bioinformatics/beast:10.5.0

First, once: add the registry and make it your default

apptainer remote add --no-login idia-registry https://sregistry.idia.ac.za
apptainer remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

apptainer remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

apptainer pull library://bioinformatics/beast:10.5.0

Shell into the container

apptainer shell library://bioinformatics/beast:10.5.0

Run the container

apptainer run library://bioinformatics/beast:10.5.0
BEAST X 10.5.0 (formerly BEAST 1.x; 10.5.0 is the successor to 1.10.5), with BEAGLE 4.1
built for CUDA 12.2. Bayesian phylogenetic analysis of molecular sequences.

Run with --nv to use the GPU through BEAGLE, and check what BEAST can see with
-beagle_info.

Usage:
  singularity run --nv beast_10.5.0.sif -beagle_gpu analysis.xml
  singularity run --app treeannotator beast_10.5.0.sif in.trees out.tree

Apps: beast (the default), beauti, loganalyser, logcombiner, treeannotator, treestat.
The GUI apps (beauti, treestat) need an X display, e.g. ssh -X to the node.

The beast launcher caps the Java heap at 2 GB. For more, run
  singularity exec beast_10.5.0.sif java -Xmx16g -Djava.library.path=/opt/beagle/lib \
    -cp /opt/beast/lib/beast.jar dr.app.beast.BeastMain analysis.xml

Documentation: https://beast.community

This image has 6 apps. Pick one to see how to use it.

singularity run --app beast library://bioinformatics/beast:10.5.0

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

BEAST X: Bayesian MCMC phylogenetics. Runs an analysis XML (usually made with BEAUti) and
writes the parameter and tree logs it names. BEAGLE here is built for CUDA: add --nv and
-beagle_gpu to use the GPU, and -beagle_info to list the resources BEAST can see. This is
also the image's default runscript.

  singularity run --nv --app beast beast_10.5.0.sif -beagle_gpu -seed 42 analysis.xml

The launcher caps the Java heap at 2 GB (the image's help shows how to raise it) and passes
arguments unquoted, so keep spaces out of file names.

Docs: https://beast.community/beast

Runs

exec beast "$@"
singularity run --app beauti library://bioinformatics/beast:10.5.0

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

BEAUti, the GUI that builds a BEAST analysis XML from alignments, dates and model choices.
It needs an X display: connect with ssh -X (or -Y), then

  singularity run --app beauti beast_10.5.0.sif

Docs: https://beast.community/beauti

Runs

exec beauti "$@"
singularity run --app loganalyser library://bioinformatics/beast:10.5.0

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

Console summary of a BEAST parameter log: mean, standard error, median, 95% HPD and ESS
for each trace.

  singularity run --app loganalyser beast_10.5.0.sif -burnin 1000000 run.log summary.txt

-burnin is in states, not samples. Run it with -help for the other options. It has no
docs page of its own; Tracer is the GUI equivalent.

Docs: https://beast.community/tracer

Runs

exec loganalyser "$@"
singularity run --app logcombiner library://bioinformatics/beast:10.5.0

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

Combines the logs of independent BEAST runs, dropping each one's burn-in; -trees combines
.trees files. With no arguments it opens a dialog instead, which needs an X display.

  singularity run --app logcombiner beast_10.5.0.sif -burnin 1000000 run1.log run2.log combined.log

-burnin is in states, not samples. -resample thins the output.

Docs: https://beast.community/logcombiner

Runs

exec logcombiner "$@"
singularity run --app treeannotator library://bioinformatics/beast:10.5.0

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

Summarises a BEAST tree sample as one target tree, annotated with posterior clade support,
node-height HPDs and any traits. The target defaults to HIPSTR; -type mcc gives the
maximum clade credibility tree. With no arguments it opens a dialog instead, which needs
an X display.

  singularity run --app treeannotator beast_10.5.0.sif -type mcc -burnin 1000000 -heights median run.trees mcc.tree

-burnin is in states (-burninTrees counts trees). The launcher caps the Java heap at 4 GB.

Docs: https://beast.community/treeannotator

Runs

exec treeannotator "$@"
singularity run --app treestat library://bioinformatics/beast:10.5.0

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

TreeStat, a GUI that calculates statistics (tree length, root height, gamma, Colless index...)
for each tree in a BEAST tree sample and writes them as a table. It takes no arguments
and needs an X display: connect with ssh -X (or -Y), then

  singularity run --app treestat beast_10.5.0.sif

Docs: https://beast.community/treestat

Runs

exec treestat "$@"
Bootstrap: docker
From: nvidia/cuda:12.2.2-devel-ubuntu22.04
Stage: build

%post
  BEAGLE_VERSION=4.1
  export DEBIAN_FRONTEND=noninteractive

  apt-get update -y
  # NOTE: the full JDK, not -headless: CMake's FindJNI fails without the AWT library.
  apt-get install -y --no-install-recommends \
    build-essential \
    ca-certificates \
    cmake \
    openjdk-21-jdk \
    pkg-config \
    wget
  export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64

  cd /tmp || exit 1
  wget -q "https://github.com/beagle-dev/beagle-lib/archive/refs/tags/v${BEAGLE_VERSION}.tar.gz"
  tar -xzf "v${BEAGLE_VERSION}.tar.gz"
  mkdir "beagle-lib-${BEAGLE_VERSION}/build"
  cd "beagle-lib-${BEAGLE_VERSION}/build" || exit 1
  # NOTE: native-arch optimisation off. It defaults on, which would tune the CPU code to the
  #   CI runner's CPU and could crash with illegal instructions on the cluster's nodes.
  #   OpenCL is off: CUDA covers the cluster's NVIDIA GPUs.
  cmake \
    -DCMAKE_INSTALL_PREFIX=/opt/beagle \
    -DBEAGLE_OPTIMIZE_FOR_NATIVE_ARCH=OFF \
    -DBUILD_CUDA=ON \
    -DBUILD_OPENCL=OFF \
    -DBUILD_JNI=ON \
    ..
  make -j"$(nproc)"
  make install

Bootstrap: docker
From: nvidia/cuda:12.2.2-runtime-ubuntu22.04
Stage: final

%labels
  Maintainer IDIA <support@ilifu.ac.za>
  Version 10.5.0
  BEAST_Version 10.5.0
  BEAGLE_Version 4.1
  CUDA_Version 12.2.2
  Source https://github.com/beast-dev/beast-mcmc

%help
  BEAST X 10.5.0 (formerly BEAST 1.x; 10.5.0 is the successor to 1.10.5), with BEAGLE 4.1
  built for CUDA 12.2. Bayesian phylogenetic analysis of molecular sequences.

  Run with --nv to use the GPU through BEAGLE, and check what BEAST can see with
  -beagle_info.

  Usage:
    singularity run --nv beast_10.5.0.sif -beagle_gpu analysis.xml
    singularity run --app treeannotator beast_10.5.0.sif in.trees out.tree

  Apps: beast (the default), beauti, loganalyser, logcombiner, treeannotator, treestat.
  The GUI apps (beauti, treestat) need an X display, e.g. ssh -X to the node.

  The beast launcher caps the Java heap at 2 GB. For more, run
    singularity exec beast_10.5.0.sif java -Xmx16g -Djava.library.path=/opt/beagle/lib \
      -cp /opt/beast/lib/beast.jar dr.app.beast.BeastMain analysis.xml

  Documentation: https://beast.community

%files from build
  /opt/beagle /opt/beagle

%environment
  export PATH=/opt/beast/bin:${PATH}
  # The beast launcher adds LD_LIBRARY_PATH to Java's library path, which is how it finds
  # BEAGLE's JNI library.
  export LD_LIBRARY_PATH=/opt/beagle/lib:${LD_LIBRARY_PATH}

%post
  BEAST_VERSION=10.5.0
  export DEBIAN_FRONTEND=noninteractive

  apt-get update -y
  # NOTE: the full JRE, not -headless, so the GUI apps (beauti, treestat, and logcombiner or
  #   treeannotator run without arguments) can open a window over X11. Swing needs a font
  #   at startup, and --no-install-recommends leaves fonts out, hence fontconfig and DejaVu.
  apt-get install -y --no-install-recommends \
    ca-certificates \
    fontconfig \
    fonts-dejavu-core \
    openjdk-21-jre \
    wget
  rm -rf /var/lib/apt/lists/*
  apt-get clean

  cd /opt || exit 1
  wget -q "https://github.com/beast-dev/beast-mcmc/releases/download/v${BEAST_VERSION}/BEAST_X_v${BEAST_VERSION}.tgz"
  tar -xzf "BEAST_X_v${BEAST_VERSION}.tgz"
  mv "BEASTv${BEAST_VERSION}" beast
  rm "BEAST_X_v${BEAST_VERSION}.tgz"

%runscript
  exec beast "$@"

%apprun beast
  exec beast "$@"

%apphelp beast
  BEAST X: Bayesian MCMC phylogenetics. Runs an analysis XML (usually made with BEAUti) and
  writes the parameter and tree logs it names. BEAGLE here is built for CUDA: add --nv and
  -beagle_gpu to use the GPU, and -beagle_info to list the resources BEAST can see. This is
  also the image's default runscript.

    singularity run --nv --app beast beast_10.5.0.sif -beagle_gpu -seed 42 analysis.xml

  The launcher caps the Java heap at 2 GB (the image's help shows how to raise it) and passes
  arguments unquoted, so keep spaces out of file names.

  Docs: https://beast.community/beast

%apprun beauti
  exec beauti "$@"

%apphelp beauti
  BEAUti, the GUI that builds a BEAST analysis XML from alignments, dates and model choices.
  It needs an X display: connect with ssh -X (or -Y), then

    singularity run --app beauti beast_10.5.0.sif

  Docs: https://beast.community/beauti

%apprun loganalyser
  exec loganalyser "$@"

%apphelp loganalyser
  Console summary of a BEAST parameter log: mean, standard error, median, 95% HPD and ESS
  for each trace.

    singularity run --app loganalyser beast_10.5.0.sif -burnin 1000000 run.log summary.txt

  -burnin is in states, not samples. Run it with -help for the other options. It has no
  docs page of its own; Tracer is the GUI equivalent.

  Docs: https://beast.community/tracer

%apprun logcombiner
  exec logcombiner "$@"

%apphelp logcombiner
  Combines the logs of independent BEAST runs, dropping each one's burn-in; -trees combines
  .trees files. With no arguments it opens a dialog instead, which needs an X display.

    singularity run --app logcombiner beast_10.5.0.sif -burnin 1000000 run1.log run2.log combined.log

  -burnin is in states, not samples. -resample thins the output.

  Docs: https://beast.community/logcombiner

%apprun treeannotator
  exec treeannotator "$@"

%apphelp treeannotator
  Summarises a BEAST tree sample as one target tree, annotated with posterior clade support,
  node-height HPDs and any traits. The target defaults to HIPSTR; -type mcc gives the
  maximum clade credibility tree. With no arguments it opens a dialog instead, which needs
  an X display.

    singularity run --app treeannotator beast_10.5.0.sif -type mcc -burnin 1000000 -heights median run.trees mcc.tree

  -burnin is in states (-burninTrees counts trees). The launcher caps the Java heap at 4 GB.

  Docs: https://beast.community/treeannotator

%apprun treestat
  exec treestat "$@"

%apphelp treestat
  TreeStat, a GUI that calculates statistics (tree length, root height, gamma, Colless index...)
  for each tree in a BEAST tree sample and writes them as a table. It takes no arguments
  and needs an X display: connect with ssh -X (or -Y), then

    singularity run --app treestat beast_10.5.0.sif

  Docs: https://beast.community/treestat

%test
  # No GPU at build time, so this checks BEAST loads BEAGLE through JNI and finds its CPU
  # resource; the CUDA plugin is checked for separately.
  beast -beagle_info 2>&1 | tee /tmp/beagle_info.txt
  grep -q 'CPU' /tmp/beagle_info.txt || exit 1
  # The GUI apps need AWT's X11 toolkit, which only the full JRE ships.
  test -f /usr/lib/jvm/java-21-openjdk-amd64/lib/libawt_xawt.so || exit 1
  ls /opt/beagle/lib/libhmsbeagle-cuda*.so*
Download bioinformatics-beast_10.5.0.def
#!/bin/sh

  exec beast "$@"
#!/bin/sh

  # No GPU at build time, so this checks BEAST loads BEAGLE through JNI and finds its CPU
  # resource; the CUDA plugin is checked for separately.
  beast -beagle_info 2>&1 | tee /tmp/beagle_info.txt
  grep -q 'CPU' /tmp/beagle_info.txt || exit 1
  # The GUI apps need AWT's X11 toolkit, which only the full JRE ships.
  test -f /usr/lib/jvm/java-21-openjdk-amd64/lib/libawt_xawt.so || exit 1
  ls /opt/beagle/lib/libhmsbeagle-cuda*.so*
# /.singularity.d/env/10-docker2singularity.sh
#!/bin/sh
export PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export NVARCH="${NVARCH:-"x86_64"}"
export NVIDIA_REQUIRE_CUDA="${NVIDIA_REQUIRE_CUDA:-"cuda>=12.2 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526"}"
export NV_CUDA_CUDART_VERSION="${NV_CUDA_CUDART_VERSION:-"12.2.140-1"}"
export NV_CUDA_COMPAT_PACKAGE="${NV_CUDA_COMPAT_PACKAGE:-"cuda-compat-12-2"}"
export CUDA_VERSION="${CUDA_VERSION:-"12.2.2"}"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-"/usr/local/nvidia/lib:/usr/local/nvidia/lib64"}"
export NVIDIA_VISIBLE_DEVICES="${NVIDIA_VISIBLE_DEVICES:-"all"}"
export NVIDIA_DRIVER_CAPABILITIES="${NVIDIA_DRIVER_CAPABILITIES:-"compute,utility"}"
export NV_CUDA_LIB_VERSION="${NV_CUDA_LIB_VERSION:-"12.2.2-1"}"
export NV_NVTX_VERSION="${NV_NVTX_VERSION:-"12.2.140-1"}"
export NV_LIBNPP_VERSION="${NV_LIBNPP_VERSION:-"12.2.1.4-1"}"
export NV_LIBNPP_PACKAGE="${NV_LIBNPP_PACKAGE:-"libnpp-12-2=12.2.1.4-1"}"
export NV_LIBCUSPARSE_VERSION="${NV_LIBCUSPARSE_VERSION:-"12.1.2.141-1"}"
export NV_LIBCUBLAS_PACKAGE_NAME="${NV_LIBCUBLAS_PACKAGE_NAME:-"libcublas-12-2"}"
export NV_LIBCUBLAS_VERSION="${NV_LIBCUBLAS_VERSION:-"12.2.5.6-1"}"
export NV_LIBCUBLAS_PACKAGE="${NV_LIBCUBLAS_PACKAGE:-"libcublas-12-2=12.2.5.6-1"}"
export NV_LIBNCCL_PACKAGE_NAME="${NV_LIBNCCL_PACKAGE_NAME:-"libnccl2"}"
export NV_LIBNCCL_PACKAGE_VERSION="${NV_LIBNCCL_PACKAGE_VERSION:-"2.19.3-1"}"
export NCCL_VERSION="${NCCL_VERSION:-"2.19.3-1"}"
export NV_LIBNCCL_PACKAGE="${NV_LIBNCCL_PACKAGE:-"libnccl2=2.19.3-1+cuda12.2"}"
export NVIDIA_PRODUCT_NAME="${NVIDIA_PRODUCT_NAME:-"CUDA"}"
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow


  export PATH=/opt/beast/bin:${PATH}
  # The beast launcher adds LD_LIBRARY_PATH to Java's library path, which is how it finds
  # BEAGLE's JNI library.
  export LD_LIBRARY_PATH=/opt/beagle/lib:${LD_LIBRARY_PATH}