Spaces:
Sleeping
Sleeping
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +2 -2
dash_plotly_QC_scRNA.py
CHANGED
|
@@ -412,8 +412,8 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
| 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")
|
| 414 |
result = dff_5.select([
|
| 415 |
-
pl.when((pl.col('
|
| 416 |
-
.then(pl.col('
|
| 417 |
.otherwise(None).alias("%"),
|
| 418 |
])
|
| 419 |
result = result.with_columns(pl.col("%").fill_null(1.0))
|
|
|
|
| 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")
|
| 414 |
result = dff_5.select([
|
| 415 |
+
pl.when((pl.col('len').is_not_null()) & (pl.col('total').is_not_null()))
|
| 416 |
+
.then(pl.col('len') / pl.col('total'))
|
| 417 |
.otherwise(None).alias("%"),
|
| 418 |
])
|
| 419 |
result = result.with_columns(pl.col("%").fill_null(1.0))
|