Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make app callable from commandl ine by just doing scdefg after pip installing. #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions scdefg/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import time
#! python
import warnings
from flask import Flask, jsonify, request, render_template, Blueprint
import logging
Expand All @@ -9,18 +8,14 @@
import scvi
import numpy as np
import plotly.graph_objects as go
import plotly
import time
import click
import flask

# ignore annoying pandas future warning
warnings.simplefilter(action='ignore', category=FutureWarning)

print('🧮 🧬 📊 🧫 🧪 scdefg: scvi-tools Differential Expression Flask GUI 📱 🎲 📈 🦠 📉 🎰')
print('You are using scvi-tools version:', scvi.__version__)
print('You are using flask version:', flask.__version__)
print('You are using plotly version:', plotly.__version__)
print('Using scvi-tools version', scvi.__version__)


# set up logs and flask blueprints
logging.basicConfig(level=logging.INFO)
Expand Down Expand Up @@ -336,17 +331,6 @@ def receive_submission():

return app

print('💜 Launching... 💜')
launch()

if __name__ == '__main__':
print('Starting launch function...')
launch()

else:
# this code is run if the file is imported as a module
#
# os.environ reads env variables from the system
# APP_SELECTION_COLUMNS is passed as a single variable, so it needs to be split
app = run(scvi_tools_model_path=os.environ["SCVI_TOOLS_MODEL_PATH"],
selection_columns=os.environ["APP_SELECTION_COLUMNS"].split(","),
intro_text_html=os.environ["APP_INTRO_TEXT_HTML"], host=os.environ["APP_HOST"], port=os.environ["APP_PORT"],
run_app=False)
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
long_description = fh.read()
setuptools.setup(
name="scdefg",
version="0.2.0",
version="0.3.0",
author="Eduardo da Veiga Beltrame",
author_email="[email protected]",
description="A single page Flask app with GUI for performing differential expression on with scvi-tools.",
Expand All @@ -17,6 +17,7 @@
license='LICENSE.txt',
packages=setuptools.find_packages(),
install_requires=requirements,
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
Expand All @@ -26,6 +27,8 @@
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
entry_points={"console_scripts": ["scdefg = scdefg.app:launch"]},
python_requires='>=3.6',

)