Spaces:
Sleeping
Sleeping
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +6 -5
dash_plotly_QC_scRNA.py
CHANGED
|
@@ -383,11 +383,12 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
| 383 |
|
| 384 |
# Calculate the mean expression
|
| 385 |
round_precision = 2
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
|
|
|
| 391 |
|
| 392 |
fig_pie = px.pie(names=labels, values=values, title=pie_title,template="seaborn")
|
| 393 |
|
|
|
|
| 383 |
|
| 384 |
# Calculate the mean expression
|
| 385 |
round_precision = 2
|
| 386 |
+
for i in condition3_chosen:
|
| 387 |
+
category_means = dff.group_by(condition3_chosen).agg(pl.col(condition3_chosen).count().alias("count"))
|
| 388 |
+
category_sums = dff.group_by(condition3_chosen).agg(pl.col(condition3_chosen).sum().alias("sum"))
|
| 389 |
+
total_count = len(dff)
|
| 390 |
+
category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias(i))
|
| 391 |
+
values_mean = category_means[i].to_list()
|
| 392 |
|
| 393 |
fig_pie = px.pie(names=labels, values=values, title=pie_title,template="seaborn")
|
| 394 |
|