Christina Theodoris
commited on
Commit
•
9e8dbe5
1
Parent(s):
c4b1f94
Add handling for case of alt_states being empty list
Browse files
geneformer/in_silico_perturber_stats.py
CHANGED
@@ -129,7 +129,9 @@ def isp_aggregate_grouped_perturb(cos_sims_df, dict_list):
|
|
129 |
# stats comparing cos sim shifts towards goal state of test perturbations vs random perturbations
|
130 |
def isp_stats_to_goal_state(cos_sims_df, dict_list, cell_states_to_model, genes_perturbed):
|
131 |
cell_state_key = cell_states_to_model["start_state"]
|
132 |
-
if "alt_states" not in cell_states_to_model.keys()
|
|
|
|
|
133 |
alt_end_state_exists = False
|
134 |
elif (len(cell_states_to_model["alt_states"]) > 0) and (cell_states_to_model["alt_states"] != [None]):
|
135 |
alt_end_state_exists = True
|
|
|
129 |
# stats comparing cos sim shifts towards goal state of test perturbations vs random perturbations
|
130 |
def isp_stats_to_goal_state(cos_sims_df, dict_list, cell_states_to_model, genes_perturbed):
|
131 |
cell_state_key = cell_states_to_model["start_state"]
|
132 |
+
if ("alt_states" not in cell_states_to_model.keys())
|
133 |
+
or (len(cell_states_to_model["alt_states"]) == 0)
|
134 |
+
or (cell_states_to_model["alt_states"] == [None]):
|
135 |
alt_end_state_exists = False
|
136 |
elif (len(cell_states_to_model["alt_states"]) > 0) and (cell_states_to_model["alt_states"] != [None]):
|
137 |
alt_end_state_exists = True
|