-
Make sure that you have successfully completed the prerequisite installation steps
-
Create and activate a python virtual environment using your preferred method. Some options are
venv
andminiconda
. Here is a cheatsheet of commands to manage your virtual environment withminiconda
.NOTE: As of this writing on 06/12/2023, you should create your virtual environment with
python 3.10
or greater-
If you have installed
miniconda
, here is a list of basic virtual environment management commands:$ conda create -n <env-name> python=3.10 # creates virtual environment $ conda activate <env-name> # activates virtual environment $ conda deactivate # deactivate virtual environment
-
If you are using
venv
, here is a list of basic virtual environment management commands:$ cd single-cell-data-portal # root of this code repo $ python3 -m venv venv/ # create virtual environment $ source venv/bin/activate # activate virtual environment $ deactivate # deactivate virtual environment
-
-
Install pygraphviz - There is currently a problem with installing
pygraphviz
on Mac OSX. This package is needed for the WMG pipeline. The installation problem and the solution is explained herebrew install graphviz
pip install --global-option=build_ext --global-option="-I$(brew --prefix graphviz)/include/" --global-option="-L$(brew --prefix graphviz)/lib/" pygraphviz==1.11
-
Install packages for WMG api -
pip install -r python_dependencies/backend/requirements.txt
-
Install packages for WMG pipeline -
pip install -r python_dependencies/wmg/requirements.txt
- Run unit tests for WMG api -
pytest -v tests/unit/backend/wmg
- Run unit tests for WMG pipeline -
pytest -v tests/unit/wmg_processing
Run functional tests for WMG api against the dev
environment.
NOTE: dev
environment is a remote environment. These functional tests run locally against a backend in a remote environment called dev
.
AWS_PROFILE=single-cell-dev DEPLOYMENT_STAGE=dev pytest -v tests/functional/backend/wmg/test_wmg_api.py
You may run into issues with finding _libvips
if you're running a Jupyter notebook locally that calls pyvips
, such as when running CXG conversion locally. The error may look like this:
ModuleNotFoundError Traceback (most recent call last)
File ~/miniconda3/envs/py11/lib/python3.11/site-packages/pyvips/__init__.py:19
18 try:
---> 19 import _libvips
21 logger.debug('Loaded binary module _libvips')
ModuleNotFoundError: No module named '_libvips'
To resolve this, you'll need to install vips
with brew install vips
, because this is a dependency that pyvips
has. If you're using conda, you'll have to also tell your conda environment where homebrew installed vips
. You can do this with:
mkdir -p ~/miniconda3/envs/<CONDA_ENV_NAME>/etc/conda/activate.d
touch ~/miniconda3/envs/<CONDA_ENV_NAME>/etc/conda/activate.d/env_vars.sh
echo 'export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH' >> ~/miniconda3/envs/<CONDA_ENV_NAME>/etc/conda/activate.d/env_vars.sh