diff --git a/Readme.md b/Readme.md index 7ee0843..08dd79f 100644 --- a/Readme.md +++ b/Readme.md @@ -4,6 +4,8 @@ Cellxgene Gateway allows you to use the Cellxgene Server provided by the Chan Zu ## Running locally +We assume your current working directory is the directory into which you've cloned this repository. + 0. This project requires python 3.6 or higher. Please check your version with ```bash @@ -23,6 +25,26 @@ source .cellxgene-gateway/bin/activate pip install -r requirements.txt ``` +1. Install the gateway: + +_To install in development mode:_ + +```bash +python setup.py develop +``` + +_To install from GitHub:_ + +```bash +pip install git+https://github.com/Novartis/cellxgene-gateway +``` + +_To install from PyPI:_ + +```bash +# NOT YET DONE, COMING! STAY TUNED +``` + 1. Prepare a folder with .h5ad files, for example ```bash @@ -30,27 +52,33 @@ mkdir ../cellxgene_data wget https://github.com/chanzuckerberg/cellxgene/raw/master/example-dataset/pbmc3k.h5ad -O ../cellxgene_data/pbmc3k.h5ad ``` -1. Copy run.sh.example to run.sh: +1. Set your environment variables correctly: ```bash -cp run.sh.example run.sh +export CELLXGENE_LOCATION=`which cellxgene` +export CELLXGENE_DATA=../cellxgene_data # change this directory if you put data in a different place. +export GATEWAY_HOST=localhost:5005 +export GATEWAY_PROTOCOL=http +export GATEWAY_IP=127.0.0.1 ``` -`run.sh` defines various environment variables: +1. Now, execute the cellxgene gateway: -* `DEPLOYMENT_ENV` - expects 'dev', 'tst' or 'prd' -* `CELLXGENE_LOCATION` - the location of the cellxgene executable, e.g. ~/anaconda2/envs/cellxgene/bin/cellxgene -* `CELLXGENE_DATA` - a directory that can contain subdirectories with .h5ad data files, *without* trailing slash, e.g. /mnt/cellxgene_data -* `GATEWAY_HOST` - the hostname and port that the gateway will run on, typically localhost:5005 if running locally +```bash +cellxgene-gateway +``` + +For convenience, you can also change `run.sh.example` and execute it. + +Here's what the environment variables mean: + +* `CELLXGENE_LOCATION` - the location of the cellxgene executable, e.g. `~/anaconda2/envs/cellxgene/bin/cellxgene` +* `CELLXGENE_DATA` - a directory that can contain subdirectories with `.h5ad` data files, *without* trailing slash, e.g. `/mnt/cellxgene_data` +* `GATEWAY_HOST` - the hostname and port that the gateway will run on, typically `localhost:5005` if running locally * `GATEWAY_PROTOCOL` - typically http when running locally, can be https when deployed if the gateway is behind a load balancer or reverse proxy. -The defaults should be fine if you set up a venv and cellxgene_data folder as above. +The defaults should be fine if you set up a venv and cellxgene_data folder as above. -1. Finally, execute run.sh: - -``` -source run.sh -``` # Customization @@ -63,29 +91,23 @@ The current paradigm for customization is to modify files during a build or depl Currently we use a build.sh that copies the gateway to a "build" directory before modifying with sed and the like. -# Development # +# Development -## Running Linters ## +## Running Linters pip install isort flake8 black -``` +```bash isort -rc . -``` - -``` flake8 . +black -l 79 . ``` -``` -black . -``` - -# Getting Help # +# Getting Help If you need help for any reason, please make a github ticket. One of the contributors should help you out. -# Contributors # +# Contributors * Niket Patel - https://github.com/NiketPatel9 * Alok Saldanha - https://github.com/alokito diff --git a/cellxgene_gateway.egg-info/PKG-INFO b/cellxgene_gateway.egg-info/PKG-INFO deleted file mode 100644 index 7c8dfff..0000000 --- a/cellxgene_gateway.egg-info/PKG-INFO +++ /dev/null @@ -1,12 +0,0 @@ -Metadata-Version: 1.1 -Name: cellxgene-gateway -Version: 0.1 -Summary: Cell-by-gene Gateway -Home-page: http://github.com/Novartis/cellxgene-gateway -Author: Niket Patel, Yohann Potier, Alok Saldanha -Author-email: alok.saldanha@novartis.com -License: MIT -Description: UNKNOWN -Keywords: visualization,genomics -Platform: UNKNOWN -Classifier: Topic :: Scientific/Engineering :: Visualization diff --git a/cellxgene_gateway.egg-info/SOURCES.txt b/cellxgene_gateway.egg-info/SOURCES.txt deleted file mode 100644 index 5c52134..0000000 --- a/cellxgene_gateway.egg-info/SOURCES.txt +++ /dev/null @@ -1,20 +0,0 @@ -setup.py -cellxgene_gateway/__init__.py -cellxgene_gateway/backend_cache.py -cellxgene_gateway/cache_entry.py -cellxgene_gateway/cellxgene_exception.py -cellxgene_gateway/dir_util.py -cellxgene_gateway/env.py -cellxgene_gateway/extra_scripts.py -cellxgene_gateway/gateway.py -cellxgene_gateway/path_util.py -cellxgene_gateway/process_exception.py -cellxgene_gateway/prune_process_cache.py -cellxgene_gateway/subprocess_backend.py -cellxgene_gateway/util.py -cellxgene_gateway.egg-info/PKG-INFO -cellxgene_gateway.egg-info/SOURCES.txt -cellxgene_gateway.egg-info/dependency_links.txt -cellxgene_gateway.egg-info/entry_points.txt -cellxgene_gateway.egg-info/requires.txt -cellxgene_gateway.egg-info/top_level.txt \ No newline at end of file diff --git a/cellxgene_gateway.egg-info/dependency_links.txt b/cellxgene_gateway.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/cellxgene_gateway.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/cellxgene_gateway.egg-info/entry_points.txt b/cellxgene_gateway.egg-info/entry_points.txt deleted file mode 100644 index 6bb9dea..0000000 --- a/cellxgene_gateway.egg-info/entry_points.txt +++ /dev/null @@ -1,3 +0,0 @@ -[console_scripts] -cellxgene-gateway = cellxgene_gateway.gateway:main - diff --git a/cellxgene_gateway.egg-info/requires.txt b/cellxgene_gateway.egg-info/requires.txt deleted file mode 100644 index 19bb2ef..0000000 --- a/cellxgene_gateway.egg-info/requires.txt +++ /dev/null @@ -1,5 +0,0 @@ -cellxgene -flask -flask_api -psutil -requests diff --git a/cellxgene_gateway.egg-info/top_level.txt b/cellxgene_gateway.egg-info/top_level.txt deleted file mode 100644 index 0224ebb..0000000 --- a/cellxgene_gateway.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -cellxgene_gateway