Spaces:
Sleeping
Sleeping
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +2 -2
dash_plotly_QC_scRNA.py
CHANGED
|
@@ -384,8 +384,8 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
| 384 |
# Calculate the mean expression
|
| 385 |
round_precision = 2
|
| 386 |
for i in condition3_chosen:
|
| 387 |
-
category_means = dff.group_by(
|
| 388 |
-
category_sums = dff.group_by(
|
| 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()
|
|
|
|
| 384 |
# Calculate the mean expression
|
| 385 |
round_precision = 2
|
| 386 |
for i in condition3_chosen:
|
| 387 |
+
category_means = dff.group_by(i).agg(pl.col(i).count().alias("count"))
|
| 388 |
+
category_sums = dff.group_by(i).agg(pl.col(i).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()
|