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

Update dash_plotly_QC_scRNA.py

Browse files
Files changed (1) hide show
  1. dash_plotly_QC_scRNA.py +3 -3
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(condition1_chosen).agg(pl.col(condition1_chosen).count().alias("count"))
387
- category_sums = dff.group_by(condition1_chosen).agg(pl.col(condition1_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()
@@ -437,7 +437,7 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
437
  #labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
438
  hover_name='batch',template="seaborn")
439
 
440
- fig_scatter_12 = px.pie(names=labels, values=values_mean,template="seaborn")
441
 
442
  fig_violin2 = px.violin(data_frame=dff, x=condition1_chosen, y=condition2_chosen, box=True, points="all",
443
  color=condition1_chosen, hover_name=condition1_chosen,template="seaborn")
 
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()
 
437
  #labels={'X_umap-0': 'umap1' , 'X_umap-1': 'umap2'},
438
  hover_name='batch',template="seaborn")
439
 
440
+ fig_scatter_12 = px.pie(names=labels, values=values_mean, title=pie_title,template="seaborn")
441
 
442
  fig_violin2 = px.violin(data_frame=dff, x=condition1_chosen, y=condition2_chosen, box=True, points="all",
443
  color=condition1_chosen, hover_name=condition1_chosen,template="seaborn")