knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
In terms of Giotto Suite, the best way to install and load Giotto python Environment is to use the installGiottoEnvironment() function and activate the Giotto Environment via createGiottoInstructions(). The installGiottoEnvironment function will install required packages from r-miniconda and createGiottoInstructions will search for giotto environment and load it into R.
library(Giotto) installGiottoEnvironment() instrs = createGiottoInstructions(save_dir = results_folder, save_plot = TRUE, show_plot = FALSE)
Unfortunately, sometimes r-miniconda may have a problem or something else happens. A manually installation of required python package via miniconda is needed. Before you try to install python packages, make sure you have the miniconda installed
python
conda env create -n giotto
conda activate giotto
conda install pandas networkx python-igraph leidenalg python-louvain python.app scikit-learn -c conda-forge
conda info
You should be able to find the conda environment path/to/conda/envs/giotto from the listed active env location
for OSX:
path/to/conda/envs/giotto/bin/pythonw
for linux:
path/to/conda/envs/giotto/bin/python
for windows:
path/to/conda/envs/giotto/python.exe
library(Giotto) intrs = createGiottoInstructions(python_path = "path/to/conda/envs/giotto/bin/python")
Alternatively, load the python path directly from reticulate would also work:
reticulate::use_python("path/to/conda/envs/giotto/bin/python")
Or this should also work: note the conda_install_location path should be able to found by "conda av data dir" from conda info
reticulate::use_condaenv(conda = conda_install_location, condaenv = "giotto")
Note that load library(reticulate) might result in loading the first python environment on the machine and the loaded python cannot be overwritten until a new R session was created. So avoid loading the reticulate library before a giotto python environment is loaded. You can always check if the correct python was loaded:
reticulate::py_config()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.