Christina Theodoris commited on
Commit
019165f
1 Parent(s): 912860d

Modify documentation for modeling only 2 cell states

Browse files
geneformer/in_silico_perturber.py CHANGED
@@ -382,8 +382,7 @@ class InSilicoPerturber:
382
  Cell states to model if testing perturbations that achieve goal state change.
383
  Single-item dictionary with key being cell attribute (e.g. "disease").
384
  Value is tuple of three lists indicating start state, goal end state, and alternate possible end states.
385
- If no alternate possible end states, third list should be empty or have a single element that is None.
386
- (i.e. the third list should be [] or [None]).
387
  max_ncells : None, int
388
  Maximum number of cells to test.
389
  If None, will test all cells.
 
382
  Cell states to model if testing perturbations that achieve goal state change.
383
  Single-item dictionary with key being cell attribute (e.g. "disease").
384
  Value is tuple of three lists indicating start state, goal end state, and alternate possible end states.
385
+ If no alternate possible end states, third list should be empty (i.e. the third list should be []).
 
386
  max_ncells : None, int
387
  Maximum number of cells to test.
388
  If None, will test all cells.
geneformer/in_silico_perturber_stats.py CHANGED
@@ -108,7 +108,7 @@ def get_impact_component(test_value, gaussian_mixture_model):
108
 
109
  # stats comparing cos sim shifts towards goal state of test perturbations vs random perturbations
110
  def isp_stats_to_goal_state(cos_sims_df, dict_list, cell_states_to_model):
111
- if (cell_states_to_model["disease"][2] == []) | (cell_states_to_model["disease"][2] == [None]):
112
  alt_end_state_exists = False
113
  elif (len(cell_states_to_model["disease"][2]) > 0) & (cell_states_to_model["disease"][2] != [None]):
114
  alt_end_state_exists = True
@@ -400,8 +400,7 @@ class InSilicoPerturberStats:
400
  Cell states to model if testing perturbations that achieve goal state change.
401
  Single-item dictionary with key being cell attribute (e.g. "disease").
402
  Value is tuple of three lists indicating start state, goal end state, and alternate possible end states.
403
- If no alternate possible end states, third list should be empty or have a single element that is None.
404
- (i.e. the third list should be [] or [None]).
405
  token_dictionary_file : Path
406
  Path to pickle file containing token dictionary (Ensembl ID:token).
407
  gene_name_id_dictionary_file : Path
 
108
 
109
  # stats comparing cos sim shifts towards goal state of test perturbations vs random perturbations
110
  def isp_stats_to_goal_state(cos_sims_df, dict_list, cell_states_to_model):
111
+ if cell_states_to_model["disease"][2] == []:
112
  alt_end_state_exists = False
113
  elif (len(cell_states_to_model["disease"][2]) > 0) & (cell_states_to_model["disease"][2] != [None]):
114
  alt_end_state_exists = True
 
400
  Cell states to model if testing perturbations that achieve goal state change.
401
  Single-item dictionary with key being cell attribute (e.g. "disease").
402
  Value is tuple of three lists indicating start state, goal end state, and alternate possible end states.
403
+ If no alternate possible end states, third list should be empty (i.e. the third list should be []).
 
404
  token_dictionary_file : Path
405
  Path to pickle file containing token dictionary (Ensembl ID:token).
406
  gene_name_id_dictionary_file : Path