Installation

Minimal installation

To use core functionalities (smoother.SpatialWeightMatrix and smoother.SpatialLoss), Smoother can be directly installed using pip

# from PyPI (stable version)
$ pip install smoother-omics

# or from github (latest version)
$ pip install git+https://github.com/JiayuSuPKU/Smoother.git#egg=smoother-omics

Note

This will be enough if you do not plan to run spatial dimensionality reduction models and convex optimization solvers.

Minimal software dependencies include

torch
scipy
scikit-learn
pandas
tqdm

Full installation

Models in the dimensionality reduction module (smoother.models.reduction.SpatialVAE, smoother.models.reduction.SpatialANVI, smoother.models.reduction.SpatialMULTIVI) is built upon scvi-tools (v1.4.0). We refer to the original repository for installation instructions on different systems.

# either separately install scvi-tools
$ pip install torch jax scvi-tools==1.4.0

# or install it together with Smoother
$ pip install smoother-omics[scvi]

To solve data imputation and deconvolution models using convex optimization, you need to also install the CVXPY package.

# either separately install cvxpy
$ pip install cvxpy==1.7.3

# or install it together with Smoother
$ pip install smoother-omics[cvxpy]

To run simulation scripts under /simulation, we recommend using the Conda environment provided in the repo. You can create a new Conda environment called ‘smoother’ and install the package in it using the following commands:

# download the repo from github
$ git clone git@github.com:JiayuSuPKU/Smoother.git

# cd into the repo and create a new conda environment called 'smoother'
$ conda env create --file environment.yml
$ conda activate smoother

# add the new conda enviroment to Jupyter
$ python -m ipykernel install --user --name=smoother

# install the package
$ pip install -e .[scvi,cvxpy]

The following software dependencies specified in the environment.yml will be installed

name: smoother
channels:
- conda-forge
dependencies:
- python<4.0
- pip
- scipy
- pytorch
- pandas
- scanpy
- python-igraph
- leidenalg
- scvi-tools
- scikit-learn
- matplotlib==3.5.3
- plotnine==0.8.0
- jupyterlab
- ipywidgets
- pynndescent
- cvxpy
- pip:
   - squidpy
   - fuzzy-c-means
   - scikit-bio==0.5.8

Reporting issues

If you encounter any issues during installation or usage, please report them on the GitHub Issues page.