Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +3 -2
dash_plotly_QC_scRNA.py
CHANGED
@@ -405,8 +405,9 @@ 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_long1 =
|
409 |
-
|
|
|
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")
|
|
|
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_long.melt(id_vars="batch", variable_name="Gene")#.group_by(pl.all()).agg(pl.len())
|
409 |
+
count = 1
|
410 |
+
dff_long2 = dff_long1.with_columns(pl.lit(count).alias("len"))
|
411 |
dff_long3 = dff_long2.filter(value = 0).group_by(["batch", "Gene"]).agg(pl.sum("len").alias("total"))
|
412 |
dff_long4 = dff_long2.group_by(["batch", "Gene"]).agg(pl.sum("len").alias("total"))
|
413 |
dff_5 = dff_long4.join(dff_long3, on=["batch","Gene"], how="outer")
|