Instructions to use ctheodoris/Geneformer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ctheodoris/Geneformer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="ctheodoris/Geneformer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("ctheodoris/Geneformer") model = AutoModelForMaskedLM.from_pretrained("ctheodoris/Geneformer", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Christina Theodoris commited on
Commit ·
78517d8
1
Parent(s): 9e8dbe5
Re-update stats to handle case of empty alt_states
Browse files
geneformer/in_silico_perturber_stats.py
CHANGED
|
@@ -129,8 +129,8 @@ 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 |
-
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]):
|
|
|
|
| 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]):
|