Linux software installation

From 22115
Revision as of 13:24, 7 July 2026 by Gorm (talk | contribs)
Jump to navigation Jump to search

These are instructions for how to install software and data used on the course Computational Molecular Evolution (22115) when using the Linux operating system.

The commands assume you are using the apt package manager used on e.g. Ubuntu Linux.

Note (ARM CPUs): These instructions assume an Intel/AMD (x86_64) CPU. If you are on an ARM-based machine (which is uncommon for linux or windows): most tools still work, but a few precompiled programs (notably PAUP*) have no ARM build. If this applies to you, please get in touch and we will find a working setup.

# Use the out-commented commands below if you want to copy my premade .bashrc file for customising bash
# WARNING: do not owerwrite a pre-existing .bashrc unless you are sure it contains nothing you want to keep
# NOTE: if you are using a different shell, then you should use the corresponding .rc file (e.g., .zshrc for zsh)
# wget https://teaching.healthtech.dtu.dk/material/22115/bashrc.txt
# mv bashrc.txt ~/.bashrc
# Compiler, make, other system tools needed below
sudo apt-get install build-essential
# Java
# NOTE: install the JDK (not just the JRE): its headers are needed to build BEAGLE's
# Java/JNI plugin below, which is what lets BEAST use BEAGLE. The JDK also runs the
# Java-based tools (BEAST, jModelTest, Tracer, ...).
sudo apt install openjdk-17-jdk
# Nedit
# NOTE: you can use any plain-text editor you prefer
sudo apt update
sudo apt -y install nedit
# MrBayes + BEAGLE library (the BEAGLE library is shared with BEAST X, see below)
sudo apt -y install git cmake build-essential libopenmpi-dev openmpi-bin
BEAGLE_TAG=$(git ls-remote --tags --refs https://github.com/beagle-dev/beagle-lib.git 'v*' | sed 's|.*/||' | sort -V | tail -n1)
git clone --depth=1 --branch "$BEAGLE_TAG" https://github.com/beagle-dev/beagle-lib.git ~/beagle-lib
cd ~/beagle-lib
JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac)))) cmake -S . -B build -DBUILD_OPENCL=OFF -DBUILD_CUDA=OFF -DBUILD_JNI=ON
cmake --build build -j
sudo cmake --install build
sudo ldconfig
cd ~
git clone --depth=1 https://github.com/NBISweden/MrBayes.git ~/MrBayes
cd ~/MrBayes
./configure --with-mpi --with-beagle=/usr/local
make
sudo make install
cd ~
 # PAUP
# PAUP*'s Linux build is x86_64 and links a few libraries not present by default on
# recent Ubuntu. Two come from apt (libcurl-gnutls.so.4 via libcurl3-gnutls, and
# libquadmath.so.0 via libquadmath0); the other two (libgfortran.so.4 and libpython2.7)
# are from older releases, so we drop those into /usr/local/lib. After this, paup runs
# as a plain command -- no wrapper or LD_LIBRARY_PATH needed.
sudo apt -y install libcurl3-gnutls libquadmath0
wget https://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-7/libgfortran4_7.5.0-6ubuntu2_amd64.deb
wget https://archive.ubuntu.com/ubuntu/pool/universe/p/python2.7/libpython2.7_2.7.18-1~20.04.7_amd64.deb
dpkg-deb -x libgfortran4_7.5.0-6ubuntu2_amd64.deb /tmp/paup-libs
dpkg-deb -x libpython2.7_2.7.18-1~20.04.7_amd64.deb /tmp/paup-libs
sudo cp -a /tmp/paup-libs/usr/lib/x86_64-linux-gnu/libgfortran.so.4* /usr/local/lib/
sudo cp -a /tmp/paup-libs/usr/lib/x86_64-linux-gnu/libpython2.7.so* /usr/local/lib/
sudo ldconfig
rm -r /tmp/paup-libs libgfortran4_7.5.0-6ubuntu2_amd64.deb libpython2.7_2.7.18-1~20.04.7_amd64.deb
wget https://phylosolutions.com/paup-test/paup4a169_ubuntu64.gz
gunzip paup4a169_ubuntu64.gz
chmod 755 paup4a169_ubuntu64
sudo mv paup4a169_ubuntu64 /usr/local/bin/paup
# IQ-TREE 3
wget https://github.com/iqtree/iqtree3/releases/download/v3.0.1/iqtree-3.0.1-Linux.tar.gz
sudo tar -xvf iqtree-3.0.1-Linux.tar.gz --directory /usr/local/src
echo "alias iqtree3='/usr/local/src/iqtree-3.0.1-Linux/bin/iqtree3'" >> ~/.bashrc
# PAML
wget https://github.com/abacus-gene/paml/releases/download/v4.10.10/paml-4.10.10-linux-x86_64.tar.gz
tar -xvf paml-4.10.10-linux-x86_64.tar.gz
sudo cp paml-4.10.10-linux-x86_64/bin/* /usr/local/bin
rm -r paml-4.10.10-linux-x86_64*
# jmodeltest
wget https://github.com/ddarriba/jmodeltest2/files/157117/jmodeltest-2.1.10.tar.gz
sudo tar -xvf jmodeltest-2.1.10.tar.gz --directory /usr/local/src
rm jmodeltest-2.1.10.tar.gz
echo "alias jmodeltest='java -jar /usr/local/src/jmodeltest-2.1.10/jModelTest.jar'" >> ~/.bashrc
# BEASTX
# NOTE: BEAST X automatically uses the BEAGLE library we built into /usr/local above
wget https://github.com/beast-dev/beast-mcmc/releases/download/v10.5.0/BEAST_X_v10.5.0.tgz
sudo tar -zxvf BEAST_X_v10.5.0.tgz --directory /usr/local/src
echo 'PATH="/usr/local/src/BEASTv10.5.0/bin${PATH:+:${PATH}}"' >> ~/.bashrc
# FigTree
sudo apt -y install figtree
# Tracer
wget https://github.com/beast-dev/tracer/releases/download/v1.7.2/Tracer_v1.7.2.tgz
sudo mkdir /usr/local/src/Tracer
sudo tar -zxf Tracer_v1.7.2.tgz --directory /usr/local/src/Tracer
sudo ln -s /usr/local/src/Tracer/bin/tracer /usr/local/bin/
rm Tracer_v1.7.2.tgz
# TempEst
wget --content-disposition 'https://tree.bio.ed.ac.uk/download.php?id=102&num=3'
sudo tar -zxf TempEst_v1.5.3.tgz --directory /usr/local/src/
sudo chmod 755 /usr/local/src/TempEst_v1.5.3/bin/tempest
sudo ln -s /usr/local/src/TempEst_v1.5.3/bin/tempest /usr/local/bin/
rm TempEst_v1.5.3.tgz
# MAFFT
sudo apt -y install mafft
# Aliview
wget https://ormbunkar.se/aliview/downloads/linux/linux-version-1.30/aliview.install.run
chmod 755 aliview.install.run
sudo ./aliview.install.run
rm aliview.install.run
# Anders Gorm software: sumt, seqconverter, phylotreelib
# https://github.com/agormp/phylotreelib
# https://github.com/agormp/sumt
# https://github.com/agormp/seqconverter
sudo apt-get install python3-pip
pip3 install seqconverter
pip3 install phylotreelib
pip3 install sumt
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
# maxalign tool (see: https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-8-312)
wget https://teaching.healthtech.dtu.dk/material/22115/maxalign.pl
chmod 755 maxalign.pl
sudo mv maxalign.pl /usr/local/bin
# Dependencies for R-packages
sudo apt -y install libcurl4-openssl-dev libxml2-dev libgit2-dev libopenblas-base
# Clean up
sudo apt autoremove --purge
sudo apt clean
# Activate changes to .bashrc in current shell
source ~/.bashrc
# Set up molevol directory for course exercises
# You can place this directory anywhere you prefer:
# Just replace tilde (~) in the command below with path to preferred base directory
# (The tilde symbol is short for the user's home directory)
cd ~
mkdir molevol
wget https://teaching.healthtech.dtu.dk/material/22115/data.tar.gz
tar -xvf data.tar.gz --directory molevol
rm data.tar.gz
R, RStudio
  • NOTE: windows users should install the native Windows version and use that
  • Download newest version of R from CRAN and follow instructions to install.
  • Download newest version of RStudio from posit.co and follow instructions
# R packages (do this inside Rstudio)
install.packages("tidyverse")
install.packages("bayesplot")
install.packages("hexbin")