Arts-of-coding commited on
Commit
dccf4ef
1 Parent(s): c5675da

Update dash_plotly_QC_scRNA.py

Browse files
Files changed (1) hide show
  1. 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("batch").agg(pl.col("batch").count().alias("count"))
387
- category_sums = dff.group_by("batch").agg(pl.col("batch").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()
 
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()