Linux software installation: Difference between revisions

From 22115
Jump to navigation Jump to search
No edit summary
No edit summary
 
(29 intermediate revisions by the same user not shown)
Line 4: Line 4:
The commands assume you are using the [https://ubuntu.com/server/docs/package-management apt package manager] used on e.g. Ubuntu Linux.
The commands assume you are using the [https://ubuntu.com/server/docs/package-management apt package manager] used on e.g. Ubuntu Linux.


'''Note''': If your computer uses a CPU based on the ARM architecture, rather than the more common Intel or AMD (x86_64) architectures, some commands may need to be adjusted. Please let me know if this applies to you, so I can provide additional instructions tailored for ARM-based systems
'''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
  # Use the out-commented commands below if you want to copy my premade .bashrc file for customising bash
Line 11: Line 11:
  # wget https://teaching.healthtech.dtu.dk/material/22115/bashrc.txt
  # wget https://teaching.healthtech.dtu.dk/material/22115/bashrc.txt
  # mv bashrc.txt ~/.bashrc
  # 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
  # Nedit
# NOTE: you can use any plain-text editor you prefer
  sudo apt update
  sudo apt update
  sudo apt -y install nedit
  sudo apt -y install nedit


  # R, Rstudio
  # MrBayes + BEAGLE library (the BEAGLE library is shared with BEAST X, see below)
  sudo apt -y install r-base r-base-dev gdebi-core
  sudo apt -y install git cmake build-essential libopenmpi-dev openmpi-bin
  wget https://download1.rstudio.org/electron/jammy/amd64/rstudio-2024.12.0-467-amd64.deb
  BEAGLE_TAG=$(git ls-remote --tags --refs https://github.com/beagle-dev/beagle-lib.git 'v*' | sed 's|.*/||' | sort -V | tail -n1)
  sudo gdebi -n ./rstudio-2024.12.0-467-amd64.deb
  git clone --depth=1 --branch "$BEAGLE_TAG" https://github.com/beagle-dev/beagle-lib.git ~/beagle-lib
rm rstudio-2024.12.0-467-amd64.deb
  cd ~/beagle-lib
 
  JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac)))) cmake -S . -B build -DBUILD_OPENCL=OFF -DBUILD_CUDA=OFF -DBUILD_JNI=ON
  # Dependencies for R-packages
  cmake --build build -j
  sudo apt -y install libcurl4-openssl-dev libxml2-dev libgit2-dev libopenblas-base
  sudo cmake --install build
 
sudo ldconfig
  # MrBayes
cd ~
  sudo apt -y install git
  git clone --depth=1 https://github.com/NBISweden/MrBayes.git ~/MrBayes
  git clone --depth=1 https://github.com/NBISweden/MrBayes.git ~/MrBayes
  cd ~/MrBayes
  cd ~/MrBayes
  ./configure --disable-sse
  ./configure --with-mpi --with-beagle=/usr/local
  make
  make
  sudo make install
  sudo make install
  cd ..
  cd ~
# Note: above, I am using the flag --disable-sse to avoid crashes on some machines
# It is possible that mb will run faster if you omit this flag, so you may want to experiment
# with using just "./configure" instead (without the quotes)


  # PAUP
  # PAUP
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
  wget https://phylosolutions.com/paup-test/paup4a169_ubuntu64.gz
  gunzip paup4a169_ubuntu64.gz
  gunzip paup4a169_ubuntu64.gz
  chmod 755 paup4a169_ubuntu64
  chmod 755 paup4a169_ubuntu64
  sudo mv paup4a169_ubuntu64 /usr/local/bin/paup
  sudo mv paup4a169_ubuntu64 /usr/local/bin/paup
  sudo apt -y install libpython2.7
 
# 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
  # PAML
  sudo apt -y install 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
  # jmodeltest
Line 53: Line 75:
  echo "alias jmodeltest='java -jar /usr/local/src/jmodeltest-2.1.10/jModelTest.jar'" >> ~/.bashrc
  echo "alias jmodeltest='java -jar /usr/local/src/jmodeltest-2.1.10/jModelTest.jar'" >> ~/.bashrc


  # BEAST2
  # BEASTX
  wget https://github.com/CompEvol/beast2/releases/download/v2.7.7/BEAST.v2.7.7.Linux.x86.tgz
# NOTE: BEAST X automatically uses the BEAGLE library we built into /usr/local above
  sudo tar -zxvf BEAST.v2.7.7.Linux.x86.tgz --directory /usr/local/src
  wget https://github.com/beast-dev/beast-mcmc/releases/download/v10.5.0/BEAST_X_v10.5.0.tgz
echo "alias beauti='/usr/local/src/beast/bin/beauti > /dev/null 2> /dev/null'" >> ~/.bashrc
  sudo tar -zxvf BEAST_X_v10.5.0.tgz --directory /usr/local/src
  echo 'PATH="/usr/local/src/beast/bin${PATH:+:${PATH}}"' >> ~/.bashrc
  echo 'PATH="/usr/local/src/BEASTv10.5.0/bin${PATH:+:${PATH}}"' >> ~/.bashrc


  # FigTree
  # FigTree
Line 68: Line 90:
  sudo ln -s /usr/local/src/Tracer/bin/tracer /usr/local/bin/
  sudo ln -s /usr/local/src/Tracer/bin/tracer /usr/local/bin/
  rm Tracer_v1.7.2.tgz
  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
  # MAFFT
Line 73: Line 102:


  # Aliview
  # Aliview
  wget https://ormbunkar.se/aliview/downloads/linux/linux-version-1.28/aliview.install.run
  wget https://ormbunkar.se/aliview/downloads/linux/linux-version-1.30/aliview.install.run
  chmod 755 aliview.install.run
  chmod 755 aliview.install.run
  sudo ./aliview.install.run
  sudo ./aliview.install.run
  rm aliview.install.run
  rm aliview.install.run


  # seqconverter, sequencelib, phylotreelib
  # Anders Gorm software: sumt, seqconverter, phylotreelib
# Anders Gorm scripts and libraries:
  # https://github.com/agormp/phylotreelib
  # https://github.com/agormp/phylotreelib
# https://github.com/agormp/sumt
  # https://github.com/agormp/seqconverter
  # https://github.com/agormp/seqconverter
  sudo apt -y install python3-numpy python3-pip
  sudo apt-get install python3-pip
  pip3 install seqconverter
  pip3 install seqconverter
  pip3 install phylotreelib
  pip3 install phylotreelib
  echo 'PATH="~/.local/bin${PATH:+:${PATH}}"' >> ~/.bashrc
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)
  # maxalign tool (see: https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-8-312)
Line 91: Line 121:
  chmod 755 maxalign.pl
  chmod 755 maxalign.pl
  sudo mv maxalign.pl /usr/local/bin
  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
  # Clean up
Line 100: Line 133:


  # Set up molevol directory for course exercises
  # Set up molevol directory for course exercises
  # You can place this directory anywhere you prefer:  
  # You can place this directory anywhere you prefer:
  # Just replace tilde (~) in the command below with path to preferred base directory
  # Just replace tilde (~) in the command below with path to preferred base directory
  # (The tilde symbol is short for the user's home directory)
  # (The tilde symbol is short for the user's home directory)
Line 108: Line 141:
  tar -xvf data.tar.gz --directory molevol
  tar -xvf data.tar.gz --directory molevol
  rm data.tar.gz
  rm data.tar.gz
; R, RStudio
* NOTE: windows users should install the native Windows version and use that
* Download newest version of R from [https://cran.rstudio.com CRAN] and follow instructions to install.
* Download newest version of RStudio from [https://posit.co/download/rstudio-desktop/ posit.co] and follow instructions


  # R packages (do this inside Rstudio)
  # R packages (do this inside Rstudio)
  install.packages("tidyverse")
  install.packages("tidyverse")
  install.packages("bayesplot")
  install.packages("bayesplot")
install.packages("hexbin")

Latest revision as of 13:25, 7 July 2026

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
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")