Spaces:
Running
Running
Arts-of-coding
commited on
Update dash_plotly_QC_scRNA.py
Browse files- dash_plotly_QC_scRNA.py +1 -1
dash_plotly_QC_scRNA.py
CHANGED
@@ -397,7 +397,7 @@ def update_graph_and_pie_chart(batch_chosen, s_chosen, g2m_chosen, condition1_ch
|
|
397 |
# Specify batch column as string type and gene columns as float type
|
398 |
dff_pre = dff.with_columns(pl.lit(None).cast(pl.Utf8).alias("batch"), *[pl.col(col).cast(pl.Float64) for col in ["Cdc45", "Uhrf1", "Mcm2", "Slbp", "Mcm5", "Pola1", "Gmnn", "Cdc6", "Rrm2", "Atad2"]])
|
399 |
|
400 |
-
dff_long = dff_pre.melt(id_vars=
|
401 |
|
402 |
expression_means = dff_long.group_by(["Region", "Gene"]).agg(pl.mean("Expression"))
|
403 |
|
|
|
397 |
# Specify batch column as string type and gene columns as float type
|
398 |
dff_pre = dff.with_columns(pl.lit(None).cast(pl.Utf8).alias("batch"), *[pl.col(col).cast(pl.Float64) for col in ["Cdc45", "Uhrf1", "Mcm2", "Slbp", "Mcm5", "Pola1", "Gmnn", "Cdc6", "Rrm2", "Atad2"]])
|
399 |
|
400 |
+
dff_long = dff_pre.melt(id_vars="batch", variable_name="Gene", value_name="Expression").with_columns(pl.col("batch").cast(pl.Categorical))
|
401 |
|
402 |
expression_means = dff_long.group_by(["Region", "Gene"]).agg(pl.mean("Expression"))
|
403 |
|