Arts-of-coding commited on
Commit
9e84bb0
·
verified ·
1 Parent(s): 43119d4

Update dash_plotly_QC_scRNA.py

Browse files
Files changed (1) hide show
  1. dash_plotly_QC_scRNA.py +3 -0
dash_plotly_QC_scRNA.py CHANGED
@@ -335,6 +335,9 @@ def update_graph_and_pie_chart(col_chosen, s_chosen, g2m_chosen, condition1_chos
335
  category_counts = dff.group_by(col_chosen).agg(pl.col(col_chosen).count().alias("count"))
336
  category_counts = category_counts.with_columns(((pl.col("count") / total_count * 100).round(decimals=2)).alias("normalized_count"))
337
 
 
 
 
338
  # Display the result
339
  labels = category_counts[col_chosen].to_list()
340
  values = category_counts["normalized_count"].to_list()
 
335
  category_counts = dff.group_by(col_chosen).agg(pl.col(col_chosen).count().alias("count"))
336
  category_counts = category_counts.with_columns(((pl.col("count") / total_count * 100).round(decimals=2)).alias("normalized_count"))
337
 
338
+ # Sort the dataframe
339
+ category_counts = category_counts.sort(col_chosen)
340
+
341
  # Display the result
342
  labels = category_counts[col_chosen].to_list()
343
  values = category_counts["normalized_count"].to_list()