Manual package installation

Attention

While it is fine to install the R-package in the way described here, we do not recommend this for general users and refers to the platform specific installation instructions instead.

Step by step guide

  1. You can install the development version of cecelia like so:

Install github version
if (!require("remotes", quietly = TRUE))
  install.packages("remotes")
remotes::install_github("schienstockd/cecelia", Ncpus = 4, repos = "https://cloud.r-project.org")
  1. After the install is finished, you must install the requirements for the shiny app.

Some packages must be installed from github repos, hence this manual step after the main package installation.

Install shiny app requirements
library(cecelia)
cciaAppRequirements(repos = "https://cloud.r-project.org")
  1. Cecelia utilises a suite of flow cytometry packages, mainly from the RGLab, which needs to be installed from Bioconductor or github.

Install Bioconductor requirements
cciaBiocRequirements()
  1. You must define a base directory where configuration files, models and the shiny app will be stored.

Define base directory
cciaSetup("/REPLACE/WITH/YOUR/PATH")

In case you get stuck at any point and have to restart R, you need to redefine the path you are working on

Restart Cecelia
# if you already installed flowCore during cciaBiocRequirements, otherwise comment out
library(flowCore)
Sys.setenv(KMP_DUPLICATE_LIB_OK = "TRUE")
library(cecelia)
cciaUse("/REPLACE/WITH/YOUR/PATH")
  1. Cecelia depends on a conda environment which must be created.

There are multiple options available depending on how you would like to use the app:

  • image For image analysis on Desktop (default)

  • image-nogui For image processing without GUI

  • flow For flow cytometry analysis

Tip

Install miniconda for Apple Metal systems, see github issue.

Install miniconda
reticulate::install_miniconda()

Attention

For Apple Metal systems, you need to pre-create the conda environment otherwise it will use the wrong platform type. You might have to source conda first if the command cannot be found. reticulate::miniconda_path() will give you the conda path.

Pre-create conda environment
# if the conda command is not found
. /path/to/miniconda/etc/profile.d/conda.sh
CONDA_SUBDIR=osx-arm64 conda create -n r-cecelia-env python=3.9
Create conda environment
cciaCondaCreate(envType = "image")

Attention

If the previous command fails on PyQt5 on Apple Metal systems, preinstall napari.

Preinstall napari
cciaCondaCreate(preinstallNapari = TRUE)
  1. Download models for deep-learning segmentation, tracking and others.

Download models
cciaModels()
  1. Create shiny app in base directory.

Create shiny app.
cciaCreateApp()
  1. Adjust config

You have to adjust the parameters in ~/path/to/cecelia/custom.yml to your system and download/install:

Adjust config.
default:
  dirs:
    bioformats2raw: "/path/to/bioformats2raw"
    projects: "/your/project/directory/"
  volumes:
    SSD: "/your/ssd/directory/"
    home: "~/"
    computer: "/"
  python:
    conda:
      env: "r-cecelia-env"
      source:
        env: "r-cecelia-env"
  1. Run the app

To run the app, double-click on ~/path/to/cecelia/app/cecelia-macOSX.command.

Troubleshooting for Apple Metal systems

  • normalizePath fails to find conda executable. This is an issue with reticulate:

    Temporary fix if reticulate fails to initialise conda environment
    assignInNamespace("is_conda_python", function(x){ return(FALSE) }, ns="reticulate")
    
  • If PyQt5 did not install successfully install Qt5 on MacOS - follow SO answer. In Terminal do the following:

    Install and link PyQt5.
    brew install qt5
    brew link qt5 --force
    
  • If PyQt5 hangs at preparing metadata. In Terminal do the following:

    Install SIP and configure PyQt5
    brew install sip
    # The directory might be different depending on where r-miniconda is installed on your system
    . ~/Library/r-miniconda-arm64/etc/profile.d/conda.sh
    conda activate r-cecelia-env
    pip install pyqt5 --config-settings --confirm-license= --verbose
    
  • If tensorflow fails to import with illegal instruction you might need to install a Mac specific version, see SO answer.

  • If GPU does not work, tensorflow-metal will enable GPU support, see Medium article.

  • If you get ld: library ‘crypto’ not found during cciaBiocRequirements(), set the following environmental variables in R before trying install again (adjust program paths for your system setup).

    Make sure R knows where to look for installed libraries
    Sys.setenv(LIBRARY_PATH="/opt/homebrew/lib")
    Sys.setenv(LDFLAGS="-L/opt/homebrew/lib")
    Sys.setenv(CPPFLAGS="-I/opt/homebrew/include")
    
  • If you get ld: library ‘gfortran’ not found during install, you might need a GNU Fortran compiler: Mac OS tools

  • There are some minor issues that currently need to be patched for Noise2Void. Run patches to apply these.

    Run patches
    cciaApplyPatches()
    

Troubleshooting for Python

  • GLIBCXX_3.4.30 not found - SO answer

  • RuntimeError: GET was unable to find an engine to execute this computation - Github issue

    Install GLIBCXX libraries for python
    conda install -c conda-forge libstdcxx-ng=12