|
import uvicorn |
|
from fastapi import FastAPI |
|
from fastapi.middleware.wsgi import WSGIMiddleware |
|
from dash_plotly_QC_scRNA import app as dashboard1 |
|
|
|
|
|
|
|
import dash |
|
from dash import dcc, html, Output, Input |
|
import plotly.express as px |
|
import dash_callback_chain |
|
import yaml |
|
import polars as pl |
|
import os |
|
pl.enable_string_cache(False) |
|
|
|
config_fig = { |
|
'toImageButtonOptions': { |
|
'format': 'svg', |
|
'filename': 'custom_image', |
|
'height': 600, |
|
'width': 700, |
|
'scale': 1, |
|
} |
|
} |
|
from adlfs import AzureBlobFileSystem |
|
mountpount=os.environ['AZURE_MOUNT_POINT'], |
|
AZURE_STORAGE_ACCESS_KEY=os.getenv('AZURE_STORAGE_ACCESS_KEY') |
|
AZURE_STORAGE_ACCOUNT=os.getenv('AZURE_STORAGE_ACCOUNT') |
|
|
|
|
|
config_path = "./data/config.yaml" |
|
|
|
|
|
def read_config(filename): |
|
with open(filename, 'r') as yaml_file: |
|
config = yaml.safe_load(yaml_file) |
|
return config |
|
|
|
config = read_config(config_path) |
|
path_parquet = config.get("path_parquet") |
|
conditions = config.get("conditions") |
|
col_features = config.get("col_features") |
|
col_counts = config.get("col_counts") |
|
col_mt = config.get("col_mt") |
|
|
|
filepath = f"az://{path_parquet}" |
|
|
|
storage_options={'account_name': AZURE_STORAGE_ACCOUNT, 'account_key': AZURE_STORAGE_ACCESS_KEY,'anon': False} |
|
|
|
|
|
df = pl.read_parquet(filepath,storage_options=storage_options) |
|
|
|
|
|
|
|
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
app = FastAPI() |
|
|
|
@app.get("/") |
|
async def root(): |
|
return {"message": "Hello World"} |
|
|
|
app.mount("/dashboard1", WSGIMiddleware(dashboard1.server)) |
|
|
|
@app.get("/dashboard1") |
|
def serve_dashboard1(): |
|
|
|
return HTMLResponse(open('static/index.html', 'r').read()) |
|
|
|
|
|
if __name__ == "__main__": |
|
uvicorn.run(dashboard1, host="0.0.0.0", port=5000) |