Verifying the native installation


1. Checking the installled packages

If you installed Giotto natively then this document applies to you. Before proceeding with using Giotto, we recommend checking that the installation is successful.
qzhu@qzhu-Latitude-E5570:~$ R

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
> 
Load the Giotto library:
> library(Giotto)
Check that the following essential libraries can also be loaded. Most of these should already have been installed.
> library(reticulate)
> library(smfishHmrf)
> library(Rtsne)
> library(scran)
> library(FactoMineR)
> library(SPARK) #optional package
> library(MAST) #optional package
> library(trendsceek) #optional package
For the latter three, users can refer to their respective repositories if they would like to use them in Giotto: For smfishHmrf, see the below website:
1.1 Checking required python packages
Exit R by entering Control + d. Then:
qzhu@qzhu-Latitude-E5570:~$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> import igraph
>>> import networkx 
>>> import leidenalg 
>>> import community
>>> import smfishHmrf
>>> import silhouetteRank # optional package
>>> import SpatialDE # optional package
>>> import smfish-image-processing # package for Giotto Viewer
>>> import giotto-viewer # packge for Giotto Viewer
If any of the above is missing, then one can install using the following command. Here we illustrate for example how to install smfishHmrf. Just replace the package name with a package to be installed:
$ pip3 install --user --upgrade --no-cache-dir --no-deps smfishHmrf
For the latter optional packages, one can obtain information from below websites: For smfishHmrf, see the below website:

1.2 Check Giotto Viewer pre-requisites are installed
$ tileup 
[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead
No input file specified, Try running 'tileup -h'
$ which tileup
/usr/local/bin/tileup
$ convert -version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from skimage import io
>>> from skimage.color import rgb2gray
>>> from skimage.external.tifffile import imsave
>>> import cv2


1.3 Setting python_path variable in Giotto
Once confirmed that you have all the python modules installed, you will note down the python path, so that you can use it in Giotto instructions.
$ which python3
/usr/bin/python3 
# alternatively, if you know already the path of python3 you would like to use with Giotto, you can skip this "which" command.
Set the python_path variable in R:
> library(Giotto)
> python_path = "/usr/bin/python3"
> instrs = createGiottoInstructions(..., python_path = python_path) # exact details of "..." depends on actual dataset example. See dataset examples.
You need to set the python_path variable every time you load Giotto library.