Spaces:
Running
Running
Arts-of-coding
commited on
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +5 -22
dash_plotly_QC_scRNA.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
# Dash app to visualize scRNA-seq data quality control metrics from scanpy objects
|
2 |
# Shoutout to Coding-with-Adam for the initial template of the project:
|
3 |
# https://github.com/Coding-with-Adam/Dash-by-Plotly/blob/master/Dash%20Components/Graph/dash-graph.py
|
4 |
-
|
5 |
import dash
|
6 |
from dash import dcc, html, Output, Input
|
7 |
import plotly.express as px
|
@@ -36,18 +36,18 @@ def read_config(filename):
|
|
36 |
return config
|
37 |
|
38 |
config = read_config(config_path)
|
39 |
-
|
40 |
col_batch = config.get("col_batch")
|
41 |
col_features = config.get("col_features")
|
42 |
col_counts = config.get("col_counts")
|
43 |
col_mt = config.get("col_mt")
|
44 |
|
45 |
-
|
46 |
|
47 |
-
|
48 |
#azfs = AzureBlobFileSystem(**storage_options )
|
49 |
|
50 |
-
|
51 |
#abfs = AzureBlobFileSystem(account_name=accountname,account_key=accountkey)
|
52 |
#df = df.rename({"__index_level_0__": "Unnamed: 0"})
|
53 |
|
@@ -55,22 +55,6 @@ col_mt = config.get("col_mt")
|
|
55 |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
|
56 |
app = dash.Dash(__name__, external_stylesheets=external_stylesheets) #, requests_pathname_prefix='/dashboard1/'
|
57 |
|
58 |
-
tab0_content = html.Div([
|
59 |
-
html.Label("Dataset chosen"),
|
60 |
-
dcc.Dropdown(id='dpdn1', value="d1011/10xflexd1011_umap_clusres", multi=False,
|
61 |
-
options=["corg/10xflexcorg_umap_clusres","d1011/10xflexd1011_umap_clusres"])
|
62 |
-
])
|
63 |
-
|
64 |
-
@app.callback(
|
65 |
-
Input(component_id='dpdn1', component_property='value')
|
66 |
-
)
|
67 |
-
|
68 |
-
def update_dataset(dataset_chosen): #batch_chosen,
|
69 |
-
global df
|
70 |
-
filepath = f"az://data10xflex/{dataset_chosen}.parquet"
|
71 |
-
df = pl.read_parquet(filepath,storage_options=storage_options)
|
72 |
-
return
|
73 |
-
|
74 |
min_value = df[col_features].min()
|
75 |
max_value = df[col_features].max()
|
76 |
|
@@ -259,7 +243,6 @@ app.layout = html.Div([
|
|
259 |
dcc.Tabs(id='tabs', style= {'width': 600,
|
260 |
'font-size': '100%',
|
261 |
'height': 50}, value='tab1',children=[
|
262 |
-
dcc.Tab(label='Dataset', value='tab0', children=tab0_content),
|
263 |
dcc.Tab(label='QC', value='tab1', children=tab1_content),
|
264 |
dcc.Tab(label='Cell cycle', value='tab2', children=tab2_content),
|
265 |
dcc.Tab(label='Custom', value='tab3', children=tab3_content),
|
|
|
1 |
# Dash app to visualize scRNA-seq data quality control metrics from scanpy objects
|
2 |
# Shoutout to Coding-with-Adam for the initial template of the project:
|
3 |
# https://github.com/Coding-with-Adam/Dash-by-Plotly/blob/master/Dash%20Components/Graph/dash-graph.py
|
4 |
+
|
5 |
import dash
|
6 |
from dash import dcc, html, Output, Input
|
7 |
import plotly.express as px
|
|
|
36 |
return config
|
37 |
|
38 |
config = read_config(config_path)
|
39 |
+
path_parquet = config.get("path_parquet")
|
40 |
col_batch = config.get("col_batch")
|
41 |
col_features = config.get("col_features")
|
42 |
col_counts = config.get("col_counts")
|
43 |
col_mt = config.get("col_mt")
|
44 |
|
45 |
+
filepath = f"az://{path_parquet}"
|
46 |
|
47 |
+
storage_options={'account_name': AZURE_STORAGE_ACCOUNT, 'account_key': AZURE_STORAGE_ACCESS_KEY,'anon': False}
|
48 |
#azfs = AzureBlobFileSystem(**storage_options )
|
49 |
|
50 |
+
df = pl.read_parquet(filepath,storage_options=storage_options)
|
51 |
#abfs = AzureBlobFileSystem(account_name=accountname,account_key=accountkey)
|
52 |
#df = df.rename({"__index_level_0__": "Unnamed: 0"})
|
53 |
|
|
|
55 |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
|
56 |
app = dash.Dash(__name__, external_stylesheets=external_stylesheets) #, requests_pathname_prefix='/dashboard1/'
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
min_value = df[col_features].min()
|
59 |
max_value = df[col_features].max()
|
60 |
|
|
|
243 |
dcc.Tabs(id='tabs', style= {'width': 600,
|
244 |
'font-size': '100%',
|
245 |
'height': 50}, value='tab1',children=[
|
|
|
246 |
dcc.Tab(label='QC', value='tab1', children=tab1_content),
|
247 |
dcc.Tab(label='Cell cycle', value='tab2', children=tab2_content),
|
248 |
dcc.Tab(label='Custom', value='tab3', children=tab3_content),
|