Spaces:
Sleeping
Sleeping
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +5 -3
dash_plotly_QC_scRNA.py
CHANGED
@@ -393,13 +393,15 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
393 |
|
394 |
# Calculate the mean expression
|
395 |
round_precision = 2
|
396 |
-
|
|
|
|
|
397 |
category_means = dff.group_by(i).agg(pl.col(i).count().alias("count"))
|
398 |
category_sums = dff.group_by(i).agg(pl.col(i).sum().alias("sum"))
|
399 |
total_count = len(dff)
|
400 |
category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias(i))
|
401 |
-
|
402 |
-
|
403 |
|
404 |
fig_pie = px.pie(names=labels, values=values, title=pie_title,template="seaborn")
|
405 |
|
|
|
393 |
|
394 |
# Calculate the mean expression
|
395 |
round_precision = 2
|
396 |
+
|
397 |
+
values_mean = []
|
398 |
+
for i in ["Cdc45","Mcm2","Mcm5"]:
|
399 |
category_means = dff.group_by(i).agg(pl.col(i).count().alias("count"))
|
400 |
category_sums = dff.group_by(i).agg(pl.col(i).sum().alias("sum"))
|
401 |
total_count = len(dff)
|
402 |
category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias(i))
|
403 |
+
values_mean += category_means[i].to_list()
|
404 |
+
print(values_mean)
|
405 |
|
406 |
fig_pie = px.pie(names=labels, values=values, title=pie_title,template="seaborn")
|
407 |
|