Arts-of-coding commited on
Commit
2f6a2ac
1 Parent(s): 57a5ef0

Update dash_plotly_QC_scRNA.py

Browse files
Files changed (1) hide show
  1. dash_plotly_QC_scRNA.py +2 -0
dash_plotly_QC_scRNA.py CHANGED
@@ -376,7 +376,9 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
376
 
377
  # Calculate the mean expression
378
  round_precision = 2
 
379
  category_sums = dff.group_by(condition1_chosen).agg(pl.col(condition1_chosen).sum().alias("sum"))
 
380
  category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias("mean"))
381
 
382
  # Display the result
 
376
 
377
  # Calculate the mean expression
378
  round_precision = 2
379
+ category_counts = dff.group_by(condition1_chosen).agg(pl.col(condition1_chosen).count().alias("count"))
380
  category_sums = dff.group_by(condition1_chosen).agg(pl.col(condition1_chosen).sum().alias("sum"))
381
+ total_count = len(dff)
382
  category_means = category_sums.select((pl.col("sum") / total_count).round(round_precision).alias("mean"))
383
 
384
  # Display the result