Arts-of-coding commited on
Commit
f98bf3c
·
verified ·
1 Parent(s): 1deb7a4

Update dash_plotly_QC_scRNA.py

Browse files
Files changed (1) hide show
  1. dash_plotly_QC_scRNA.py +2 -1
dash_plotly_QC_scRNA.py CHANGED
@@ -405,7 +405,8 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
405
  expression_means = dff_long.lazy().group_by(["batch", "Gene"]).agg(pl.mean("Mean expression")).collect()
406
 
407
  # Calculate the percentage total expressed
408
- dff_long2 = dff_pre.melt(id_vars="batch", variable_name="Gene").group_by(pl.col(["batch","Gene","value"])).len()
 
409
  dff_long3 = dff_long2.filter(value = 0).group_by(["batch", "Gene"]).agg(pl.sum("len").alias("total"))
410
  dff_long4 = dff_long2.group_by(["batch", "Gene"]).agg(pl.sum("len").alias("total"))
411
  dff_5 = dff_long4.join(dff_long3, on=["batch","Gene"], how="outer")
 
405
  expression_means = dff_long.lazy().group_by(["batch", "Gene"]).agg(pl.mean("Mean expression")).collect()
406
 
407
  # Calculate the percentage total expressed
408
+ dff_long1 = dff_pre.melt(id_vars="batch", variable_name="Gene")
409
+ dff_long2 = dff_long1.group_by(pl.col(["batch","Gene","value"])).len()
410
  dff_long3 = dff_long2.filter(value = 0).group_by(["batch", "Gene"]).agg(pl.sum("len").alias("total"))
411
  dff_long4 = dff_long2.group_by(["batch", "Gene"]).agg(pl.sum("len").alias("total"))
412
  dff_5 = dff_long4.join(dff_long3, on=["batch","Gene"], how="outer")