mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 22:18:12 +08:00
Address PR review issues
This commit is contained in:
+11
-14
@@ -1,5 +1,5 @@
|
|||||||
import os
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_compress import Compress
|
from flask_compress import Compress
|
||||||
@@ -40,7 +40,7 @@ app.register_blueprint(
|
|||||||
app.add_url_rule("/", endpoint="index")
|
app.add_url_rule("/", endpoint="index")
|
||||||
|
|
||||||
|
|
||||||
def run(args):
|
def run_scanpy(args):
|
||||||
global data
|
global data
|
||||||
title = args.title
|
title = args.title
|
||||||
if not title:
|
if not title:
|
||||||
@@ -50,23 +50,20 @@ def run(args):
|
|||||||
DATASET_TITLE=title,
|
DATASET_TITLE=title,
|
||||||
CXG_API_BASE=api_base
|
CXG_API_BASE=api_base
|
||||||
)
|
)
|
||||||
if args.engine == "scanpy":
|
|
||||||
from .scanpy_engine.scanpy_engine import ScanpyEngine
|
from .scanpy_engine.scanpy_engine import ScanpyEngine
|
||||||
data = ScanpyEngine(args.data_directory, schema="data_schema.json")
|
data = ScanpyEngine(args.data_directory, schema="data_schema.json")
|
||||||
app.run(host="0.0.0.0", debug=True, port=args.port)
|
app.run(host="0.0.0.0", debug=True, port=args.port)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Cellxgene is a tool for exploring single cell expression.")
|
parser = argparse.ArgumentParser(description="Cellxgene is a tool for exploring single cell expression.")
|
||||||
|
parser.add_argument("--title", "-t", help="Title to display -- if this is omitted the title will be the name "
|
||||||
|
"of the directory from the data_directory arg")
|
||||||
|
parser.add_argument("--port", help="Port to run server on.", type=int, default=5005)
|
||||||
subparsers = parser.add_subparsers(dest="cellxgene_command")
|
subparsers = parser.add_subparsers(dest="cellxgene_command")
|
||||||
run_subparser = subparsers.add_parser("run", help="run cellxgene")
|
scanpy_subparser = subparsers.add_parser("scanpy", help="run cellxgene using the scanpy engine")
|
||||||
run_subparser.add_argument("--title", "-t", help="Title to display (default = data directory name")
|
scanpy_subparser.add_argument("data_directory", metavar="dir", help="Directory containing data and schema file")
|
||||||
run_subparser.add_argument("--port", help="Port to run server on.", type=int, default=5005)
|
scanpy_subparser.set_defaults(func=run_scanpy)
|
||||||
run_subparser.add_argument("engine", help="The underlying structure of the data")
|
|
||||||
run_subparser.add_argument("data_directory", metavar="dir", help="Directory containing data and schema")
|
|
||||||
run_subparser.set_defaults(func=run)
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
args.func(args)
|
args.func(args)
|
||||||
|
|
||||||
# app.run(host="0.0.0.0", debug=True, port=5005)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user