Skip to content

Preliminaries

Max Hill edited this page May 28, 2026 · 26 revisions

Note: The installation instructions below are primarily written for macOS and Linux users. For Windows or other operating systems, please refer to the official developer websites linked below for platform-specific installation instructions.

Preliminaries: Software Installation

Before starting the workshop activities, please install the required software below.

Software Type Purpose Website
RStudio Integrated development environment (IDE) Running R scripts and visualizing results Link
ape R package Reading, writing, and manipulating phylogenetic trees Link
phytools R package Species tree simulation and visualization Link
ms Command-line software Coalescent and gene tree simulation Link
DensiTree Standalone Java software Visualizing many gene trees simultaneously Link
Seq-Gen Command-line software Simulating sequence evolution Link
SeqKit Command-line software Toolkit for FASTA/Q file manipulation Link
AMAS (optional) Python script Program for alignment manipulation Link

1. Install R and RStudio

RStudio will be used for species tree simulation, visualization, and running R scripts throughout the workshop. Although all analyses can be performed directly in R, we use RStudio because it provides a more convenient interface for writing scripts, viewing plots, organizing files, and running commands interactively.

Download and install R and RStudio Desktop at:

https://posit.co/download/rstudio-desktop/

After installation, open RStudio and run on Console tab:

version

and you should see something like:

> version
               _                           
platform       aarch64-apple-darwin20      
arch           aarch64                     
os             darwin20                    
system         aarch64, darwin20           
status                                     
major          4                           
minor          5.1                         
year           2025                        
month          06                          
day            13                          
svn rev        88306                       
language       R                           
version.string R version 4.5.1 (2025-06-13)
nickname       Great Square Root      

2. Install Required R Packages

Open RStudio and run the following commands in the Console tab:

install.packages("phytools")
install.packages("ape")

If package installation fails, try:

install.packages("phytools", dependencies = TRUE)
install.packages("ape", dependencies = TRUE)

After installation, load the packages:

library(phytools)
library(ape)

3. Install ms

ms is a command-line coalescent simulator for generating gene trees. The following instructions work for both MacOS and Linux. First, download ms.tar.gz by clicking the link to ms.folder from:

http://home.uchicago.edu/rhudson1/source/mksamples.html

Open Terminal and navigate to the download directory using cd and extract using:

tar -xvf ms.tar.gz

To compile ms, navigate into the extracted folder:

cd msdir

And compile using:

gcc -o ms ms.c streec.c rand1.c -lm

If you want, move the executable into /usr/local/bin after compiling ms so you can run ms anywhere using:

sudo mv ms /usr/local/bin/

To verify installation, run:

./ms 4 3 -T

You should see simulated gene trees in Newick format printed.


4. Install DensiTree

DensiTree will be used to visualize many gene trees simultaneously. The following installation method works with both MacOS and Linux. First, download DensiTree.v3.1.0.jar (as of May 2026) from:

https://www.cs.auckland.ac.nz/~remco/DensiTree/DensiTree.html

DensiTree requires Java 8. Make you have updated your Java. To run DensiTree, use the command

java -jar DensiTree.v3.1.0.jar

If successful, a GUI window should appear.

If you receive a Java version error on MacOS, install Java 17:

brew install openjdk@17

Then try:

/opt/homebrew/opt/openjdk@17/bin/java -jar DensiTree.v3.1.0.jar

If you receive an error on Linux, make sure Java is properly installed using

sudo apt install default-jre

5. Install Seq-Gen

We will use the program Seq-Gen to simulate sequence evolution. The following installation method works for both MacOS and Linux. First, download Seq-Gen-1.3.5.tar.gz from Github here:

https://github.com/rambaut/Seq-Gen/releases/tag/v1.3.5

Extract with

tar -xvf Seq-Gen-1.3.5.tar.gz 

Then navigate to the directory Seq-Gen-1.3.5/source/ and run

make

You should now be able to run Seq-Gen by running ./seq-gen from the Seq-Gen-1.3.5/source/ directory. To run it easily from any directory, run

sudo mv seq-gen /usr/local/bin/

You should now be able to run Seq-Gen from any directory using the command seq-gen.

A link to the Seq-Gen manual can be found here: Seq-Gen manual.

6. Install SeqKit

We will use SeqKit for working with FASTA files. For MacOS, SeqKit can be installed using

brew install seqkit

For Debian-based systems, SeqKit can be installed using

sudo apt install seqkit

You should now be able to run SeqKit by running the shell command seqkit from any directory.

Multiple other installation methods are listed here.

For example, if the above methods do not work, one can download the binary directly from https://github.com/shenwei356/seqkit/releases/tag/v2.13.0, then extract it with tar -xvf seqkit_linux_amd64.tar.gz and copy the executable to /usr/local/bin using sudo mv seqkit /urs/local/bin/

7. AMAS (Alignment manipulation and summary statistics)

AMAS is a python script (hence requires Python3). It is optional for the tutorial, but very useful for doing certain tasks with FASTA files. It can be installed on both MacOS and Linux using the Python package installer pip with the command

pip install amas

Alternatively, you can download the script AMAS.py directly from github here and then run

chmod +x AMAS.py
sudo mv AMAS.py /usr/local/bin/

You should now be able to run the program from any directory using the shell command AMAS.py.

Clone this wiki locally