forked from Teichlab/cellphonedb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
executable file
·60 lines (41 loc) · 1.56 KB
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import click
from cellphonedb.src.api_endpoints.terminal_api.query_terminal_api_endpoints import query_terminal_commands
from cellphonedb.src.local_launchers.local_collector_launcher import LocalCollectorLauncher
from cellphonedb.src.app.flask.flask_app import create_app
from cellphonedb.src.app.cellphonedb_app import cellphonedb_app
from cellphonedb.src.local_launchers.local_exporter_launcher import LocalExporterLauncher
from cellphonedb.src.api_endpoints.terminal_api.method_terminal_api_endpoints import method_terminal_commands
app = create_app()
@app.cli.command
def run():
app.run()
@app.cli.command()
def create_db():
cellphonedb_app.cellphonedb.database_manager.database.create_all()
@app.cli.command()
def reset_db():
database = cellphonedb_app.cellphonedb.database_manager.database
database.drop_everything()
database.create_all()
@app.cli.command()
@click.argument('table')
@click.argument('file', default='')
def collect(table, file):
getattr(LocalCollectorLauncher(), table)(file)
@app.cli.command()
@click.argument('table')
def export(table):
getattr(LocalExporterLauncher(), table)()
@app.cli.group()
def method():
pass
@app.cli.group()
def query():
pass
method.add_command(method_terminal_commands.statistical_analysis)
method.add_command(method_terminal_commands.analysis)
query.add_command(query_terminal_commands.find_interactions_by_element)
query.add_command(query_terminal_commands.get_interaction_gene)
query.add_command(query_terminal_commands.autocomplete)
if __name__ == "__main__":
app.run(host='0.0.0.0')