GenePooler
#429
by
jamieb-nvs
- opened
geneformer/emb_extractor.py
CHANGED
@@ -411,7 +411,7 @@ class EmbExtractor:
|
|
411 |
self,
|
412 |
model_type="Pretrained",
|
413 |
num_classes=0,
|
414 |
-
emb_mode="
|
415 |
cell_emb_style="mean_pool",
|
416 |
gene_emb_style="mean_pool",
|
417 |
filter_data=None,
|
@@ -719,12 +719,6 @@ class EmbExtractor:
|
|
719 |
)
|
720 |
raise
|
721 |
|
722 |
-
if self.emb_label is not None:
|
723 |
-
logger.error(
|
724 |
-
"For extracting state embs, emb_label should be None since labels are based on state embs dict keys."
|
725 |
-
)
|
726 |
-
raise
|
727 |
-
|
728 |
state_embs_dict = dict()
|
729 |
state_key = cell_states_to_model["state_key"]
|
730 |
for k, v in cell_states_to_model.items():
|
|
|
411 |
self,
|
412 |
model_type="Pretrained",
|
413 |
num_classes=0,
|
414 |
+
emb_mode="cell",
|
415 |
cell_emb_style="mean_pool",
|
416 |
gene_emb_style="mean_pool",
|
417 |
filter_data=None,
|
|
|
719 |
)
|
720 |
raise
|
721 |
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
state_embs_dict = dict()
|
723 |
state_key = cell_states_to_model["state_key"]
|
724 |
for k, v in cell_states_to_model.items():
|
geneformer/in_silico_perturber_stats.py
CHANGED
@@ -640,16 +640,10 @@ def isp_stats_mixture_model(cos_sims_df, dict_list, combos, anchor_token):
|
|
640 |
cos_sims_full_df = pd.concat([cos_sims_full_df, cos_sims_df_i])
|
641 |
|
642 |
# quantify number of detections of each gene
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
]
|
648 |
-
else:
|
649 |
-
cos_sims_full_df["N_Detections"] = [
|
650 |
-
n_detections(i, dict_list, "gene", anchor_token)
|
651 |
-
for i in cos_sims_full_df["Gene"]
|
652 |
-
]
|
653 |
|
654 |
if combos == 0:
|
655 |
cos_sims_full_df = cos_sims_full_df.sort_values(
|
|
|
640 |
cos_sims_full_df = pd.concat([cos_sims_full_df, cos_sims_df_i])
|
641 |
|
642 |
# quantify number of detections of each gene
|
643 |
+
cos_sims_full_df["N_Detections"] = [
|
644 |
+
n_detections(i, dict_list, "gene", anchor_token)
|
645 |
+
for i in cos_sims_full_df["Gene"]
|
646 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
647 |
|
648 |
if combos == 0:
|
649 |
cos_sims_full_df = cos_sims_full_df.sort_values(
|