Image size: 4.8 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/popgen:0.2

Shell into the container

singularity shell library://bioinformatics/popgen:0.2

Run the container

singularity run library://bioinformatics/popgen:0.2

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/popgen:0.2

Shell into the container

apptainer shell library://bioinformatics/popgen:0.2

Run the container

apptainer run library://bioinformatics/popgen:0.2
PopGen 0.2: population genetics tools on top of RStudio 2026.07.1-147 and R 4.6.1.

  arlecore      3.5.2.2  console Arlequin
  beast         10.5.0   BEAST X, with BEAGLE 4.1 (CPU), plus beauti, loganalyser,
                         logcombiner, treeannotator and treestat
  bcftools      1.25     plus vcfutils.pl
  plink2        2.0 alpha 7 (2026-11-07 build)
  admixture     1.4.0

BEAST here is CPU-only. For the GPU, use bioinformatics/beast.

Usage:
  singularity run popgen_0.2.sif                   # RStudio Server (from the base image)
  singularity run --app plink2 popgen_0.2.sif --version
  singularity exec popgen_0.2.sif bcftools view in.vcf.gz

Apps: R, Rscript, rstudio (from the base image), arlecore, beast, beauti, loganalyser,
logcombiner, treeannotator, treestat, bcftools, vcfutils, plink2, admixture.

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

singularity run --app R library://bioinformatics/popgen:0.2

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.

Runs

exec R "${@}"
singularity run --app Rscript library://bioinformatics/popgen:0.2

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.

Runs

exec Rscript "${@}"
singularity run --app admixture library://bioinformatics/popgen:0.2

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

ADMIXTURE: maximum-likelihood ancestry estimation for K ancestral populations from a PLINK
.bed (with its .bim and .fam alongside). Writes <prefix>.K.Q (ancestry fractions) and
<prefix>.K.P (allele frequencies) to the current directory; --cv reports the
cross-validation error to help choose K, and -jN uses N threads.

  singularity run --app admixture popgen_0.2.sif --cv cohort.bed 3 -j4

Docs: https://dalexander.github.io/admixture/admixture-manual.pdf

Runs

exec admixture "$@"
singularity run --app arlecore library://bioinformatics/popgen:0.2

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

Arlequin's console version: AMOVA, F-statistics, diversity indices and neutrality tests on
an Arlequin project file (.arp). A settings file (.ars) picks the analyses; make one in
Windows Arlequin and save it.

  singularity run --app arlecore popgen_0.2.sif project.arp settings.ars run_silent

Results go in a project.res folder next to the .arp. The manual is in the image at
/opt/arlecore/Arlequin35.pdf.

Docs: https://cmpg.unibe.ch/software/arlequin35/

Runs

exec arlecore3522_64bit "$@"
singularity run --app bcftools library://bioinformatics/popgen:0.2

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

bcftools: query, filter, annotate, merge and call variants in VCF/BCF files.

  singularity run --app bcftools popgen_0.2.sif view -i 'QUAL>=30' -Oz -o filtered.vcf.gz calls.vcf.gz

Docs: https://samtools.github.io/bcftools/bcftools.html

Runs

exec bcftools "$@"
singularity run --app beast library://bioinformatics/popgen:0.2

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 CPU-only; -beagle_info lists
the resources BEAST can see.

  singularity run --app beast popgen_0.2.sif -beagle_threads 4 -seed 42 analysis.xml

The launcher caps the Java heap at 2 GB and passes arguments unquoted, so keep spaces out
of file names. For a bigger heap, call java yourself:

  singularity exec popgen_0.2.sif java -Xmx16g -Djava.library.path=/opt/beagle/lib \
    -cp /opt/beast/lib/beast.jar dr.app.beast.BeastMain analysis.xml

Docs: https://beast.community/beast

Runs

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

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 X11 display, e.g. a session opened with ssh -X.

  singularity run --app beauti popgen_0.2.sif

Docs: https://beast.community/beauti

Runs

exec beauti "$@"
singularity run --app loganalyser library://bioinformatics/popgen:0.2

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 popgen_0.2.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/popgen:0.2

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, which needs an X11 display.

  singularity run --app logcombiner popgen_0.2.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 plink2 library://bioinformatics/popgen:0.2

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

PLINK 2: genome-wide association and population-genetic analyses (QC, allele frequencies,
PCA, relatedness, regression), and conversion between VCF, PLINK 1 and PLINK 2 formats.
By default it uses every core and half the node's RAM, so set --threads and --memory (MiB)
on shared nodes.

  singularity run --app plink2 popgen_0.2.sif --vcf calls.vcf.gz --make-pgen --threads 4 --memory 8000 --out cohort

Docs: https://www.cog-genomics.org/plink/2.0/

Runs

exec plink2 "$@"
singularity run --app rstudio library://bioinformatics/popgen:0.2

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.

Runs

if [ -z "${RSTUDIO_PASSWORD}" ]; then
  RSTUDIO_PASSWORD=$( tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1 )
  export RSTUDIO_PASSWORD
  echo "The environment variable RSTUDIO_PASSWORD was not set, so your password has been chosen for you. It's: ${RSTUDIO_PASSWORD}"
fi
PORT=$( python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()' )
HOST=$( /bin/hostname )
echo "Running rserver on port ${PORT}"
echo "To connect to this server run this on your local machine:"
echo "    ssh -A ${USER}@${HOST} -o \"ProxyCommand=ssh ${USER}@slurm.ilifu.ac.za nc ${HOST} 22\" -L8081:localhost:${PORT}"
echo "then visit http://localhost:8081 in your browser and use the username \"${USER}\" to login with the password \"${RSTUDIO_PASSWORD}\""
echo "(You may need to choose a different port (other than 8081), so remember to change this in both the ssh and browser)"
exec rserver --server-user ${USER} --auth-none 0 --auth-pam-helper rstudio_auth --secure-cookie-key-file ${HOME}/.RStudio.rserver/secure-cookie.key --www-port ${PORT} --server-data-dir ${HOME}/.RStudio.rserver/data "${@}"
singularity run --app treeannotator library://bioinformatics/popgen:0.2

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, which needs an X11
display.

  singularity run --app treeannotator popgen_0.2.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/popgen:0.2

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 X11 display, e.g. a session opened with ssh -X.

  singularity run --app treestat popgen_0.2.sif

Docs: https://beast.community/treestat

Runs

exec treestat "$@"
singularity run --app vcfutils library://bioinformatics/popgen:0.2

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

vcfutils.pl, bcftools' legacy Perl helpers for plain-text VCF: listsam, subsam, fillac,
qstats, varFilter, vcf2fq and others. Run it with no arguments for the list. bcftools
itself covers most of these now (e.g. bcftools query -l for listsam).

  singularity run --app vcfutils popgen_0.2.sif listsam calls.vcf

Docs: https://github.com/samtools/bcftools/blob/1.25/misc/vcfutils.pl

Runs

exec vcfutils.pl "$@"
Bootstrap: library
Library: https://sregistry.idia.ac.za
From: ci-bot/rstudio/r4.6.1:2026.07.1-147

%labels
  Maintainer IDIA <support@ilifu.ac.za>
  Version 0.2
  R_Version 4.6.1
  RStudio_Version 2026.07.1-147
  Arlecore_Version 3.5.2.2
  BEAST_Version 10.5.0
  BEAGLE_Version 4.1
  BCFtools_Version 1.25
  PLINK2_Version 2.0.0-a.7 (2026-11-07)
  ADMIXTURE_Version 1.4.0

%help
  PopGen 0.2: population genetics tools on top of RStudio 2026.07.1-147 and R 4.6.1.

    arlecore      3.5.2.2  console Arlequin
    beast         10.5.0   BEAST X, with BEAGLE 4.1 (CPU), plus beauti, loganalyser,
                           logcombiner, treeannotator and treestat
    bcftools      1.25     plus vcfutils.pl
    plink2        2.0 alpha 7 (2026-11-07 build)
    admixture     1.4.0

  BEAST here is CPU-only. For the GPU, use bioinformatics/beast.

  Usage:
    singularity run popgen_0.2.sif                   # RStudio Server (from the base image)
    singularity run --app plink2 popgen_0.2.sif --version
    singularity exec popgen_0.2.sif bcftools view in.vcf.gz

  Apps: R, Rscript, rstudio (from the base image), arlecore, beast, beauti, loganalyser,
  logcombiner, treeannotator, treestat, bcftools, vcfutils, plink2, admixture.

%environment
  export PATH=/opt/arlecore:/opt/beast/bin:/opt/bcftools/bin:/opt/plink2:/opt/admixture:${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}
  export MANPATH=/opt/bcftools/share/man:${MANPATH}

%post
  ARLECORE_SHA256=73ed01a20f18c9204804cea06ddfb2c02e4d999e0d0f3dd81ef9d1c88b444a14
  BEAST_VERSION=10.5.0
  BEAGLE_VERSION=4.1
  BCFTOOLS_VERSION=1.25
  PLINK2_BUILD=20261107
  PLINK2_SHA256=8f931c1f5147b53171530ce9f41e4fb1312e7d3e3729c9db7f81c5dd34bb4297
  ADMIXTURE_VERSION=1.4.0
  ADMIXTURE_SHA256=5520c4f18525f49ab2c715d711b40f4a0818ef1485361a94ec8954d1364e6f19
  export DEBIAN_FRONTEND=noninteractive

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

  mkdir -p /tmp/popgen
  cd /tmp/popgen || exit 1

  # arlecore: the download isn't versioned, so the checksum pins it to 3.5.2.2.
  wget -q http://cmpg.unibe.ch/software/arlequin35/linux/arlecore_linux.zip
  echo "${ARLECORE_SHA256}  arlecore_linux.zip" | sha256sum -c -
  unzip -q arlecore_linux.zip
  mv arlecore_linux /opt/arlecore
  chmod 755 /opt/arlecore/arlecore3522_64bit
  ln -s arlecore3522_64bit /opt/arlecore/arlecore

  # BEAGLE, CPU only, for BEAST.
  # NOTE: native-arch optimisation off. It defaults on, which would tune the code to the CI
  #   runner's CPU and could crash with illegal instructions on the cluster's nodes.
  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
  cmake \
    -DCMAKE_INSTALL_PREFIX=/opt/beagle \
    -DBEAGLE_OPTIMIZE_FOR_NATIVE_ARCH=OFF \
    -DBUILD_CUDA=OFF \
    -DBUILD_OPENCL=OFF \
    -DBUILD_JNI=ON \
    ..
  make -j"$(nproc)"
  make install
  cd /tmp/popgen || exit 1

  # BEAST X
  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}" /opt/beast

  # bcftools
  wget -q "https://github.com/samtools/bcftools/releases/download/${BCFTOOLS_VERSION}/bcftools-${BCFTOOLS_VERSION}.tar.bz2"
  tar -xjf "bcftools-${BCFTOOLS_VERSION}.tar.bz2"
  cd "bcftools-${BCFTOOLS_VERSION}" || exit 1
  ./configure --prefix=/opt/bcftools
  make -j"$(nproc)"
  make install
  cd /tmp/popgen || exit 1

  # plink2: dated builds, so the checksum pins this one.
  wget -q "https://s3.amazonaws.com/plink2-assets/alpha7/plink2_linux_x86_64_${PLINK2_BUILD}.zip"
  echo "${PLINK2_SHA256}  plink2_linux_x86_64_${PLINK2_BUILD}.zip" | sha256sum -c -
  mkdir -p /opt/plink2
  unzip -q "plink2_linux_x86_64_${PLINK2_BUILD}.zip" -d /opt/plink2

  # ADMIXTURE
  wget -q "https://dalexander.github.io/admixture/binaries/admixture_linux-${ADMIXTURE_VERSION}.tar.gz"
  echo "${ADMIXTURE_SHA256}  admixture_linux-${ADMIXTURE_VERSION}.tar.gz" | sha256sum -c -
  tar -xzf "admixture_linux-${ADMIXTURE_VERSION}.tar.gz"
  mv "admixture_linux-${ADMIXTURE_VERSION}" /opt/admixture

  cd / || exit 1
  rm -rf /tmp/popgen
  apt-get clean
  apt-get autoclean
  rm -rf /var/lib/apt/lists/*

%apprun arlecore
  exec arlecore3522_64bit "$@"

%apphelp arlecore
  Arlequin's console version: AMOVA, F-statistics, diversity indices and neutrality tests on
  an Arlequin project file (.arp). A settings file (.ars) picks the analyses; make one in
  Windows Arlequin and save it.

    singularity run --app arlecore popgen_0.2.sif project.arp settings.ars run_silent

  Results go in a project.res folder next to the .arp. The manual is in the image at
  /opt/arlecore/Arlequin35.pdf.

  Docs: https://cmpg.unibe.ch/software/arlequin35/

%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 CPU-only; -beagle_info lists
  the resources BEAST can see.

    singularity run --app beast popgen_0.2.sif -beagle_threads 4 -seed 42 analysis.xml

  The launcher caps the Java heap at 2 GB and passes arguments unquoted, so keep spaces out
  of file names. For a bigger heap, call java yourself:

    singularity exec popgen_0.2.sif java -Xmx16g -Djava.library.path=/opt/beagle/lib \
      -cp /opt/beast/lib/beast.jar dr.app.beast.BeastMain analysis.xml

  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 X11 display, e.g. a session opened with ssh -X.

    singularity run --app beauti popgen_0.2.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 popgen_0.2.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, which needs an X11 display.

    singularity run --app logcombiner popgen_0.2.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, which needs an X11
  display.

    singularity run --app treeannotator popgen_0.2.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 X11 display, e.g. a session opened with ssh -X.

    singularity run --app treestat popgen_0.2.sif

  Docs: https://beast.community/treestat

%apprun bcftools
  exec bcftools "$@"

%apphelp bcftools
  bcftools: query, filter, annotate, merge and call variants in VCF/BCF files.

    singularity run --app bcftools popgen_0.2.sif view -i 'QUAL>=30' -Oz -o filtered.vcf.gz calls.vcf.gz

  Docs: https://samtools.github.io/bcftools/bcftools.html

%apprun vcfutils
  exec vcfutils.pl "$@"

%apphelp vcfutils
  vcfutils.pl, bcftools' legacy Perl helpers for plain-text VCF: listsam, subsam, fillac,
  qstats, varFilter, vcf2fq and others. Run it with no arguments for the list. bcftools
  itself covers most of these now (e.g. bcftools query -l for listsam).

    singularity run --app vcfutils popgen_0.2.sif listsam calls.vcf

  Docs: https://github.com/samtools/bcftools/blob/1.25/misc/vcfutils.pl

%apprun plink2
  exec plink2 "$@"

%apphelp plink2
  PLINK 2: genome-wide association and population-genetic analyses (QC, allele frequencies,
  PCA, relatedness, regression), and conversion between VCF, PLINK 1 and PLINK 2 formats.
  By default it uses every core and half the node's RAM, so set --threads and --memory (MiB)
  on shared nodes.

    singularity run --app plink2 popgen_0.2.sif --vcf calls.vcf.gz --make-pgen --threads 4 --memory 8000 --out cohort

  Docs: https://www.cog-genomics.org/plink/2.0/

%apprun admixture
  exec admixture "$@"

%apphelp admixture
  ADMIXTURE: maximum-likelihood ancestry estimation for K ancestral populations from a PLINK
  .bed (with its .bim and .fam alongside). Writes <prefix>.K.Q (ancestry fractions) and
  <prefix>.K.P (allele frequencies) to the current directory; --cv reports the
  cross-validation error to help choose K, and -jN uses N threads.

    singularity run --app admixture popgen_0.2.sif --cv cohort.bed 3 -j4

  Docs: https://dalexander.github.io/admixture/admixture-manual.pdf

%test
  R --version | grep -q 4.6.1
  test -x /opt/arlecore/arlecore3522_64bit
  bcftools --version | grep -q 'bcftools 1.25'
  plink2 --version
  admixture --version | grep -q 1.4.0
  beast -beagle_info 2>&1 | grep -q CPU
Download bioinformatics-popgen_0.2.def
#!/bin/sh

  if [ -z "${RSTUDIO_PASSWORD}" ]; then
    RSTUDIO_PASSWORD=$( tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1 )
    export RSTUDIO_PASSWORD
    echo "The environment variable RSTUDIO_PASSWORD was not set, so your password has been chosen for you. It's: ${RSTUDIO_PASSWORD}"
  fi
  PORT=$( python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()' )
  HOST=$( /bin/hostname )
  echo "Running rserver on port ${PORT}"
  echo "To connect to this server run this on your local machine:"
  echo "    ssh -A ${USER}@${HOST} -o \"ProxyCommand=ssh ${USER}@slurm.ilifu.ac.za nc ${HOST} 22\" -L8081:localhost:${PORT}"
  echo "then visit http://localhost:8081 in your browser and use the username \"${USER}\" to login with the password \"${RSTUDIO_PASSWORD}\""
  echo "(You may need to choose a different port (other than 8081), so remember to change this in both the ssh and browser)"
  exec rserver --server-user ${USER} --auth-none 0 --auth-pam-helper rstudio_auth --secure-cookie-key-file ${HOME}/.RStudio.rserver/secure-cookie.key --www-port ${PORT} --server-data-dir ${HOME}/.RStudio.rserver/data "${@}"
#!/bin/sh

  R --version | grep -q 4.6.1
  test -x /opt/arlecore/arlecore3522_64bit
  bcftools --version | grep -q 'bcftools 1.25'
  plink2 --version
  admixture --version | grep -q 1.4.0
  beast -beagle_info 2>&1 | grep -q CPU
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow


  export INSTALLER_PATH=/installer
  export SOFTWARE_PATH=/software
  export PATH=${SOFTWARE_PATH}/bin:${PATH}
  export LC_ALL=C
  unset XDG_RUNTIME_DIR



  export INSTALLER_PATH=/installer
  export SOFTWARE_PATH=/software
  export PATH=${SOFTWARE_PATH}/bin:${PATH}
  export LD_LIBRARY_PATH=${SOFTWARE_PATH}/lib:${LD_LIBRARY_PATH}
  export LIBRARY_PATH=${SOFTWARE_PATH}/lib:${LIBRARY_PATH}
  export CPATH=${SOFTWARE_PATH}/include:${CPATH}
  export INCLUDE=${SOFTWARE_PATH}/include/:${INCLUDE}
  export PKG_CONFIG_PATH=${SOFTWARE_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}

  export LC_ALL=C
  unset XDG_RUNTIME_DIR



  export R_VERSION=4.6.1
  export RSTUDIO_VERSION=2026.07.1-147
  export PATH=/usr/lib/rstudio-server/bin:${PATH}



  export PATH=/opt/arlecore:/opt/beast/bin:/opt/bcftools/bin:/opt/plink2:/opt/admixture:${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}
  export MANPATH=/opt/bcftools/share/man:${MANPATH}