Spaces:
Sleeping
Sleeping
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +2 -2
dash_plotly_QC_scRNA.py
CHANGED
@@ -383,8 +383,8 @@ 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 |
-
category_means = dff.group_by(
|
387 |
-
category_sums = dff.group_by(
|
388 |
total_count = len(dff)
|
389 |
category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias("mean"))
|
390 |
values_mean = category_means["mean"].to_list()
|
|
|
383 |
|
384 |
# Calculate the mean expression
|
385 |
round_precision = 2
|
386 |
+
category_means = dff.group_by(condition3_chosen).agg(pl.col(condition3_chosen).count().alias("count"))
|
387 |
+
category_sums = dff.group_by(condition3_chosen).agg(pl.col(condition3_chosen).sum().alias("sum"))
|
388 |
total_count = len(dff)
|
389 |
category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias("mean"))
|
390 |
values_mean = category_means["mean"].to_list()
|