Installation

Native Installation

Giotto consists of two modules: analyzer and viewer. The requirements of Giotto installation are:
  • R (at least 3.5.1)
  • Python (at least 3.0)
  • Java 1.6+
  • Unix / Linux environment

1. Native install on Ubuntu Linux

Once you have installed R, go into R, and install the following
library(remotes)
# to install the latest stable version (advised)
remotes::install_github("RubD/Giotto")
# to install a specific release version (example)
remotes::install_github("RubD/Giotto@v0.1.0")
# install HMRF required by Giotto
install.packages("devtools")
library(devtools)
install_bitbucket("qzhudfci/smfishhmrf-r", ref="default")
Depending on how many pre-requisites are automatically installed, this step my take up to 30 minutes for the first time installation.

1.1. Python packages
This is necessary to run all available analyses, including Leiden / Louvain clustering and to build and use the interactive visualization tool. An alternative, but less flexible, R version for Louvain clustering is also available. It is advisable to install everything within a specific conda environment and specify the python path in the R function when required. To install python packages using the the pip package manager, get a terminal in unix/linux and enter:
#pip3 install --user <package name>
pip3 install --user pandas igraph networkx leidenalg community smfishHmrf
#For smfishHmrf package, if upgrading from a previous installation, then do force install:
pip3 install --user --upgrade --no-cache-dir --no-deps smfishHmrf
1.2. Viewer
The viewer module gives you the ability to do interactive visualization of cells in physical and expression spaces, and is therefore required for an integrative experience with Giotto analyzer.
The viewer requires the following:
  • scikit-image, scikit-learn, opencv-python, smfish-image-processing (Python)
  • tileup (Ruby)
  • ImageMagick 6.7
  • Java 1.7+
#install imagemagick
sudo apt-get install imagemagick
#install ruby (if not already)
sudo apt install ruby
sudo apt install ruby-dev
#install tileup package (which is a ruby package)
sudo apt install libmagickwand-dev
sudo gem install tileup
#install python packages with pip3
pip3 install --user scikit-image 
pip3 install --user opencv-python 
pip3 install --user scikit-learn
pip3 install --user smfish-image-processing
pip3 install --user giotto-viewer



2. Native install on macOS

Download R or RStudio (version 3.5 or above). Then:
library(remotes)
# to install the latest stable version (advised)
remotes::install_github("RubD/Giotto")
# install HMRF required by Giotto
install.packages("devtools")
library(devtools)
install_bitbucket("qzhudfci/smfishhmrf-r", ref="default")
2.1. Python packages
Similar to how these tools are installed in Ubuntu, you can install the following python modules in macOS:
#pip3 install --user <package name>
pip3 install --user pandas igraph networkx leidenalg community smfishHmrf
#For smfishHmrf package, if upgrading from a previous installation, then do force install:
pip3 install --user --upgrade --no-cache-dir --no-deps smfishHmrf
If using the conda environment, install these packages by:
# pandas:
conda install -c anaconda pandas
# python-igraph, run one of the following:
conda install -c conda-forge python-igraph
conda install -c conda-forge/label/gcc7 python-igraph
conda install -c conda-forge/label/cf201901 python-igraph
# networkx:
conda install -c anaconda networkx
# louvain, run one of the following:
conda install -c conda-forge python-louvain
conda install -c conda-forge/label/gcc7 python-louvain
conda install -c conda-forge/label/cf201901 python-louvain
# leidenalg:
conda install -c conda-forge leidenalg
# smfishHmrf:
conda install -c conda-forge smfishHmrf
2.2. Viewer
MacOS X Homebrew environment instructions
For MacOS X, we need to install the Homebrew first. Get the Homebrew environment. It is easiest to install ImageMagick within Homebrew. If you don't have Homebrew, visit https://brew.sh to learn how to install it. Once Homebrew is installed, check ~/.bash_profile that you have added /usr/local/bin to $PATH variable.
cat ~/.bash_profile

#if the /usr/local/bin is missing from PATH variable within .bash_profile then please uncomment below line and do:
#echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Afterwards, do:
brew install imagemagick
brew install python@2
brew install ruby
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
brew unlink imagemagick
brew install imagemagick@6
brew link imagemagick@6 --force
echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile
Note imagemagick v6 is required for Mac OSX. Version 7 is known to have compatibility problem with Ruby rmagick package, and is therefore avoided. After doing the above, close the terminal. Open the terminal to refresh environment. Then check that the command convert works:
convert -version
Next install tileup in MacOS:
/usr/local/opt/ruby/bin/gem install rmagick
/usr/local/opt/ruby/bin/gem install tileup
echo 'export PATH="/usr/local/lib/ruby/gems/2.6.0/bin:$PATH"' >> ~/.bash_profile   #check gems version is correct
Install the necessary python packages (Python 3.6):
which python
#Then do the following:
pip3 install -U scikit-image
pip3 install opencv-python
pip3 install scikit-learn
pip3 install smfish-image-processing
pip3 install giotto-viewer



3. Native install on Windows 10

Due to the requirements of Linux packages (such as ImageMagick), native install of Giotto in Windows 10 is not supported at this moment. We recommend Docker image in this case for Windows users.