The disturbed task reported an error
Thank you for your good work and your patience in answering earlier questions. I'm currently running the Gene perturbation mission and reporting an error at the last step. May I ask you how to solve this problem? Thank you!
The code is as follows:
cell_states_to_model={"state_key": "disease",
"start_state": "dcm",
"goal_state": "nf",
"alt_states": ["hcm"]}
isp = InSilicoPerturber(perturb_type="delete",
perturb_rank_shift=None,
genes_to_perturb="all",
combos=0,
anchor_gene=None,
model_type="CellClassifier",
num_classes=3,
emb_mode="cell",
cell_emb_style="mean_pool",
cell_states_to_model=cell_states_to_model,
filter_data={"cell_type":["Cardiomyocyte1","Cardiomyocyte2","Cardiomyocyte3"]},
cell_states_to_model={'state_key': 'disease',
'start_state': 'dcm',
'goal_state': 'nf',
'alt_states': ['hcm']},
max_ncells=30,
emb_layer=0,
forward_batch_size=30,
nproc=8)
isp.perturb_data("/root/Geneformer/geneformer-12L-30M/",
"/root/Geneformer/examples/human_dcm_hcm_nf_small1.dataset/",
"/root/Geneformer/examples/new/",
"a")
ispstats = InSilicoPerturberStats(mode="goal_state_shift",
genes_perturbed="all",
combos=0,
anchor_gene=None,
cell_states_to_model=cell_states_to_model
)
ispstats.get_stats("/root/Geneformer/examples/new/",
None,
"/root/Geneformer/examples/new",
"a")
The error content is as follows:
Traceback (most recent call last):
File "", line 1, in
The File "/ root/miniconda3 / envs/myenv/lib/python3.10 / site - packages/geneformer/in_silico_perturber_stats. Py", line 694, in get_stats
cos_sims_df = isp_stats_to_goal_state(cos_sims_df_initial, dict_list, self.cell_states_to_model, self.genes_perturbed)
The File "/ root/miniconda3 / envs/myenv/lib/python3.10 / site - packages/geneformer/in_silico_perturber_stats. Py", line 170, in isp_stats_to_goal_state
goal_end_random_megalist = [goal_end for start_state,goal_end,alt_end in random_tuples]
The File "/ root/miniconda3 / envs/myenv/lib/python3.10 / site - packages/geneformer/in_silico_perturber_stats. Py", line 170, in
goal_end_random_megalist = [goal_end for start_state,goal_end,alt_end in random_tuples]
TypeError: cannot unpack non-iterable float object