Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +23 -17
dash_plotly_QC_scRNA.py
CHANGED
|
@@ -54,32 +54,38 @@ external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
|
|
| 54 |
app = dash.Dash(__name__, external_stylesheets=external_stylesheets) #, requests_pathname_prefix='/dashboard1/'
|
| 55 |
|
| 56 |
tab0_content = html.Div([
|
| 57 |
-
html.Label("Dataset chosen"),
|
| 58 |
dcc.Dropdown(id='dpdn1', value="d1011/10xflexd1011_umap_clusres", multi=False,
|
| 59 |
options=["corg/10xflexcorg_umap_clusres","d1011/10xflexd1011_umap_clusres"])
|
| 60 |
])
|
| 61 |
|
| 62 |
@app.callback(
|
|
|
|
| 63 |
Input(component_id='dpdn1', component_property='value')
|
| 64 |
)
|
| 65 |
-
|
| 66 |
-
def update_dataset(dataset_chosen): #batch_chosen,
|
| 67 |
filepath = f"az://data10xflex/{dataset_chosen}"
|
| 68 |
-
df = pl.read_parquet(filepath,storage_options=storage_options)
|
| 69 |
-
return df
|
| 70 |
|
| 71 |
-
min_value = df[col_features].min()
|
| 72 |
-
max_value = df[col_features].max()
|
| 73 |
-
|
| 74 |
-
min_value_2 = df[col_counts].min()
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
# Loads in the conditions specified in the yaml file
|
| 85 |
|
|
|
|
| 54 |
app = dash.Dash(__name__, external_stylesheets=external_stylesheets) #, requests_pathname_prefix='/dashboard1/'
|
| 55 |
|
| 56 |
tab0_content = html.Div([
|
| 57 |
+
html.Label("Dataset chosen"),
|
| 58 |
dcc.Dropdown(id='dpdn1', value="d1011/10xflexd1011_umap_clusres", multi=False,
|
| 59 |
options=["corg/10xflexcorg_umap_clusres","d1011/10xflexd1011_umap_clusres"])
|
| 60 |
])
|
| 61 |
|
| 62 |
@app.callback(
|
| 63 |
+
Output('dynamic-table', 'children'),
|
| 64 |
Input(component_id='dpdn1', component_property='value')
|
| 65 |
)
|
| 66 |
+
def update_table(dataset_chosen):
|
|
|
|
| 67 |
filepath = f"az://data10xflex/{dataset_chosen}"
|
| 68 |
+
df = pl.read_parquet(filepath, storage_options=storage_options)
|
|
|
|
| 69 |
|
| 70 |
+
min_value = df[col_features].min().item()
|
| 71 |
+
max_value = df[col_features].max().item()
|
| 72 |
+
|
| 73 |
+
min_value_2 = round(df[col_counts].min())
|
| 74 |
+
max_value_2 = round(df[col_counts].max())
|
| 75 |
+
|
| 76 |
+
min_value_3 = round(df[col_mt].min(), 1)
|
| 77 |
+
max_value_3 = round(df[col_mt].max(), 1)
|
| 78 |
+
|
| 79 |
+
# Create other visualizations or perform calculations below using the updated df variable
|
| 80 |
+
|
| 81 |
+
return [
|
| 82 |
+
html.H5(f'Minimum Value - {col_features}: {min_value}'),
|
| 83 |
+
html.H5(f'Maximum Value - {col_features}: {max_value}'),
|
| 84 |
+
html.H5(f'Minimum Value - {col_counts}: {min_value_2}'),
|
| 85 |
+
html.H5(f'Maximum Value - {col_counts}: {max_value_2}'),
|
| 86 |
+
html.H5(f'Minimum Value - {col_mt}: {min_value_3}'),
|
| 87 |
+
html.H5(f'Maximum Value - {col_mt}: {max_value_3}'),
|
| 88 |
+
]
|
| 89 |
|
| 90 |
# Loads in the conditions specified in the yaml file
|
| 91 |
|