Skip to content

Commit

Permalink
Switch to json config
Browse files Browse the repository at this point in the history
  • Loading branch information
nictru committed May 5, 2024
1 parent 90882c1 commit a8da4be
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ __pycache__/
*.py[cod]
*$py.class

# Test data
data

# C extensions
*.so

Expand Down
18 changes: 6 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
from shiny import App, reactive, ui
import scanpy as sc
import os
import pickle
import scHPL
import json

from composition import composition_server, composition_ui
from export import export_ui, export_server
from dgea.dgea import dgea_server, dgea_ui
from tree import tree_server, tree_ui

with open("data/input.txt") as f:
file_list = f.readlines()
filename = "data/" + file_list[0].strip()
treename = "data/" + file_list[1].strip()
name = file_list[2].strip()
with open("data/config.json") as f:
config = json.load(f)
adata = sc.read_h5ad("data/" + config["adata"])
tree = pickle.load(open("data/" + config["tree"], "rb"))
name = config["name"]


adata = sc.read_h5ad(filename)
categorical_columns = adata.obs.select_dtypes(include="category").columns.to_list()

tree = pickle.load(open(treename, "rb"))


app_ui = ui.page_navbar(
ui.nav_panel("Composition analysis",
composition_ui("composition")
Expand Down
5 changes: 5 additions & 0 deletions data/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"adata": "merged.h5ad",
"tree": "scarches.tree.pkl",
"name": "possible_atlas"
}
3 changes: 0 additions & 3 deletions data/input.txt

This file was deleted.

Binary file added data/scarches.tree.pkl
Binary file not shown.

0 comments on commit a8da4be

Please sign in to comment.