extract prepare from main install (#887)

* extract prepare from main install

* add requirements-prepare to manifest
This commit is contained in:
Charlotte Weaver
2019-08-21 14:26:01 -07:00
committed by GitHub
parent b8c05763fe
commit 28c4d28308
6 changed files with 28 additions and 26 deletions
-5
View File
@@ -185,11 +185,6 @@ def launch(
else:
click.echo(f"[cellxgene] Loading data from {basename(data)}.")
# Fix for anaconda python. matplotlib typically expects python to be installed as a framework TKAgg is usually
# available and fixes this issue. See https://matplotlib.org/faq/virtualenv_faq.html
import matplotlib as mpl
mpl.use("TkAgg")
from server.app.scanpy_engine.scanpy_engine import ScanpyEngine
try:
+21 -15
View File
@@ -41,18 +41,18 @@ from scipy.sparse.csc import csc_matrix
"--make-var-names-unique", default=True, is_flag=True, help="Ensure var index is unique.", show_default=True
)
def prepare(
data,
layout,
recipe,
output,
plotting,
sparse,
overwrite,
set_obs_names,
set_var_names,
run_qc,
make_obs_names_unique,
make_var_names_unique,
data,
layout,
recipe,
output,
plotting,
sparse,
overwrite,
set_obs_names,
set_var_names,
run_qc,
make_obs_names_unique,
make_var_names_unique,
):
"""Preprocesses data for use with cellxgene.
@@ -65,10 +65,16 @@ def prepare(
# collect slow imports here to make CLI startup more responsive
click.echo("[cellxgene] Starting CLI...")
import matplotlib
try:
import matplotlib
matplotlib.use("Agg")
import scanpy as sc
matplotlib.use("Agg")
import scanpy as sc
except ImportError:
raise click.ClickException(
"[cellxgene] cellxgene prepare has not been installed. Please run `pip install cellxgene[prepare]` "
"to install the necessary requirements."
)
# scanpy settings
sc.settings.verbosity = 0