Spaces:
Sleeping
Sleeping
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +3 -3
dash_plotly_QC_scRNA.py
CHANGED
@@ -399,10 +399,10 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
399 |
dff_pre = dff.select(list_conds)
|
400 |
|
401 |
# Melt wide format DataFrame into long format
|
402 |
-
dff_long = dff_pre.melt(id_vars="batch", variable_name="Gene", value_name="
|
403 |
|
404 |
# Calculate the mean expression levels for each gene in each region
|
405 |
-
expression_means = dff_long.lazy().groupby(["batch", "Gene"]).agg(pl.mean("
|
406 |
|
407 |
#expression_means = expression_means.select(["batch", "Gene", "Expression"] + condition3_chosen)
|
408 |
|
@@ -454,7 +454,7 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
454 |
#labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
|
455 |
hover_name='batch',template="seaborn")
|
456 |
|
457 |
-
fig_scatter_12 = px.scatter(data_frame=expression_means, x="
|
458 |
#labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
|
459 |
hover_name='batch',template="seaborn")
|
460 |
|
|
|
399 |
dff_pre = dff.select(list_conds)
|
400 |
|
401 |
# Melt wide format DataFrame into long format
|
402 |
+
dff_long = dff_pre.melt(id_vars="batch", variable_name="Gene", value_name="Mean expression")
|
403 |
|
404 |
# Calculate the mean expression levels for each gene in each region
|
405 |
+
expression_means = dff_long.lazy().groupby(["batch", "Gene"]).agg(pl.mean("Mean expression")).collect()
|
406 |
|
407 |
#expression_means = expression_means.select(["batch", "Gene", "Expression"] + condition3_chosen)
|
408 |
|
|
|
454 |
#labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
|
455 |
hover_name='batch',template="seaborn")
|
456 |
|
457 |
+
fig_scatter_12 = px.scatter(data_frame=expression_means, x="Gene", y="batch", color="Mean expression",
|
458 |
#labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
|
459 |
hover_name='batch',template="seaborn")
|
460 |
|