Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +5 -3
dash_plotly_QC_scRNA.py
CHANGED
|
@@ -395,10 +395,12 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
| 395 |
|
| 396 |
# Melt wide format DataFrame into long format
|
| 397 |
# Specify batch column as string type and gene columns as float type
|
| 398 |
-
dff_pre = dff.
|
| 399 |
-
|
| 400 |
-
|
|
|
|
| 401 |
|
|
|
|
| 402 |
expression_means = dff_long.group_by(["Region", "Gene"]).agg(pl.mean("Expression"))
|
| 403 |
|
| 404 |
fig_pie = px.pie(names=labels, values=values, title=pie_title,template="seaborn")
|
|
|
|
| 395 |
|
| 396 |
# Melt wide format DataFrame into long format
|
| 397 |
# Specify batch column as string type and gene columns as float type
|
| 398 |
+
dff_pre = dff.select(["Region","Cdc45","Mcm5"])
|
| 399 |
+
|
| 400 |
+
# Melt wide format DataFrame into long format
|
| 401 |
+
dff_long = df.melt(id_vars="Region", variable_name="Gene", value_name="Expression")
|
| 402 |
|
| 403 |
+
# Calculate the mean expression levels for each gene in each region
|
| 404 |
expression_means = dff_long.group_by(["Region", "Gene"]).agg(pl.mean("Expression"))
|
| 405 |
|
| 406 |
fig_pie = px.pie(names=labels, values=values, title=pie_title,template="seaborn")
|