Arts-of-coding
commited on
Commit
•
25dfa01
1
Parent(s):
e82a9c1
Update pages/Cornea_v1_integrated_scVI.py
Browse files
pages/Cornea_v1_integrated_scVI.py
CHANGED
@@ -358,7 +358,7 @@ def update_graph_and_pie_chart(col_chosen, s_chosen, g2m_chosen, condition1_chos
|
|
358 |
#(pl.col(col_counts) <= range_value_2[1]) &
|
359 |
#(pl.col(col_mt) >= range_value_3[0]) &
|
360 |
#(pl.col(col_mt) <= range_value_3[1])
|
361 |
-
)
|
362 |
|
363 |
# #Drop categories that are not in the filtered data
|
364 |
# dff = dff.with_columns(dff[col_chosen].cast(pl.Categorical))
|
@@ -393,7 +393,7 @@ def update_graph_and_pie_chart(col_chosen, s_chosen, g2m_chosen, condition1_chos
|
|
393 |
dff_long = dff_pre.melt(id_vars=col_chosen, variable_name="Gene", value_name="Mean expression")
|
394 |
|
395 |
# Calculate the mean expression levels for each gene in each region
|
396 |
-
expression_means = dff_long.group_by([col_chosen, "Gene"]).agg(pl.mean("Mean expression"))
|
397 |
|
398 |
# Calculate the percentage total expressed
|
399 |
dff_long1 = dff_pre.melt(id_vars=col_chosen, variable_name="Gene")#.group_by(pl.all()).agg(pl.len())
|
|
|
358 |
#(pl.col(col_counts) <= range_value_2[1]) &
|
359 |
#(pl.col(col_mt) >= range_value_3[0]) &
|
360 |
#(pl.col(col_mt) <= range_value_3[1])
|
361 |
+
).collect()
|
362 |
|
363 |
# #Drop categories that are not in the filtered data
|
364 |
# dff = dff.with_columns(dff[col_chosen].cast(pl.Categorical))
|
|
|
393 |
dff_long = dff_pre.melt(id_vars=col_chosen, variable_name="Gene", value_name="Mean expression")
|
394 |
|
395 |
# Calculate the mean expression levels for each gene in each region
|
396 |
+
expression_means = dff_long.lazy().group_by([col_chosen, "Gene"]).agg(pl.mean("Mean expression")).collect() #
|
397 |
|
398 |
# Calculate the percentage total expressed
|
399 |
dff_long1 = dff_pre.melt(id_vars=col_chosen, variable_name="Gene")#.group_by(pl.all()).agg(pl.len())
|