mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 23:38:11 +08:00
Prepare fixes (#416)
* Error on overwrite=false but no output file * Add prepare requirements to requirements.txt * no saved output error -> warning * Catch clustering import error * lint fixes * Fix missing output message
This commit is contained in:
@@ -74,7 +74,7 @@ def launch(data, layout, diffexp, title, verbose, debug, obs_names, var_names,
|
||||
app.config.update(
|
||||
DATASET_TITLE=title,
|
||||
CXG_API_BASE=api_base
|
||||
)
|
||||
)
|
||||
|
||||
if not verbose:
|
||||
log = logging.getLogger("werkzeug")
|
||||
|
||||
+10
-1
@@ -47,6 +47,10 @@ def prepare(data, layout, recipe, output, plotting, sparse, overwrite,
|
||||
raise click.UsageError("Cannot use a recipe when forcing sparsity")
|
||||
|
||||
output = expanduser(output)
|
||||
|
||||
if not output:
|
||||
click.echo("Warning: No file will be saved, to save the results of cellxgene prepare include "
|
||||
"--output <filename> to save output to a new file")
|
||||
if isfile(output) and not overwrite:
|
||||
raise click.UsageError(f"Cannot overwrite existing file {output}, try using the flag --overwrite")
|
||||
|
||||
@@ -112,7 +116,12 @@ def prepare(data, layout, recipe, output, plotting, sparse, overwrite,
|
||||
sc.pp.neighbors(adata)
|
||||
|
||||
def run_louvain(adata):
|
||||
sc.tl.louvain(adata)
|
||||
try:
|
||||
sc.tl.louvain(adata)
|
||||
except ModuleNotFoundError:
|
||||
click.echo("\nWarning: louvain module is not installed, no clusters will be calculated. "
|
||||
"To fix this please install cellxgene with the optional feature louvain enabled: "
|
||||
"`pip install cellxgene[louvain]`")
|
||||
|
||||
def run_layout(adata):
|
||||
if len(unique(adata.obs["louvain"].values)) < 10:
|
||||
|
||||
Reference in New Issue
Block a user