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
> remotes::install_github("RubD/Giotto")
> devtools::install_bitbucket("qzhudfci/smfishhmrf-r", ref="master")
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 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+
$ sudo apt-get install imagemagick
$ sudo apt install ruby ruby-dev libmagickwand-dev
$ sudo gem install tileup
$ pip3 install --user --upgrade --no-cache-dir --no-deps scikit-image opencv-python scikit-learn smfish-image-processing giotto-viewer 


2. Native install on macOS

Download R or RStudio (version 3.5 or above). Then:
> remotes::install_github("RubD/Giotto")
> devtools::install_bitbucket("qzhudfci/smfishhmrf-r", ref="master")
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 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 following these steps below. More information about creating a python virtual environment with conda can be found in this link.

Create a yaml file (e.g. environment.yml) with the following information:
name: giotto_env
channels:
 - defaults
dependencies:
 - pip=3.4
 - pandas
 - networkx
 - python-igraph
 - leidenalg
 - python-louvain
 - python.app (!!only for OSX!!)
 - scikit-learn
 - smfishHmrf
prefix: /Users/your_username/anaconda3/envs/giotto_env
Create a conda environment based on yaml file:
$ conda env create -f environment.yml
Your new python environment will be located in the path /Users/your_username/anaconda3/envs/giotto_env.

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 python 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 python3
$ pip3 install scikit-image opencv-python scikit-learn smfish-image-processing 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.