Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.pp.construct_flows_from_cellchat error #29

Open
xy441 opened this issue Mar 2, 2025 · 1 comment
Open

fs.pp.construct_flows_from_cellchat error #29

xy441 opened this issue Mar 2, 2025 · 1 comment

Comments

@xy441
Copy link

xy441 commented Mar 2, 2025

Hello, I referred to your method and ran a similar program, but it reported an error and could not be solved. I reused 1 10,000 cells with no errors. The error data was about 200,000 cells. How should I deal with it?

fs.pp.construct_flows_from_cellchat(adata,cellchat_output_key,gem_expr_key = 'X_gem',scale_gem_expr=True,model_organism='human',flowsig_network_key='flowsig_network',flowsig_expr_key='X_flow')

error:
IndexError Traceback (most recent call last)
Cell In[35], line 1
----> 1 fs.pp.construct_flows_from_cellchat(adata,cellchat_output_key,gem_expr_key = 'X_gem',scale_gem_expr=True,model_organism='human',flowsig_network_key='flowsig_network',flowsig_expr_key='X_flow')

File ~/miniconda3/envs/FlowSig/lib/python3.11/site-packages/flowsig/preprocessing/_flow_expressions.py:243, in construct_flows_from_cellchat(adata, cellchat_output_key, gem_expr_key, scale_gem_expr, model_organism, flowsig_network_key, flowsig_expr_key)
231 def construct_flows_from_cellchat(adata: sc.AnnData,
232 cellchat_output_key: str,
233 gem_expr_key: str = 'X_gem',
(...)
239
240 # Define the expression
241 adata_outflow, outflow_vars = construct_outflow_signals_cellchat(adata, cellchat_output_key)
--> 243 adata_inflow, inflow_vars = construct_inflow_signals_cellchat(adata, cellchat_output_key, model_organism)
245 adata_gem, flow_gem_vars = construct_gem_expressions(adata, gem_expr_key, scale_gem_expr)
247 # Determine the flow_variables

File ~/miniconda3/envs/FlowSig/lib/python3.11/site-packages/flowsig/preprocessing/flow_expressions.py:73, in construct_inflow_signals_cellchat(adata, cellchat_output_key, model_organism)
70 if rec not in adata.var_names:
71 receptor_v2_split = ccc_output_merged[ccc_output_merged['interaction_name_2'] == interaction]['receptor'].unique()[0].split('
')
---> 73 receptors.append(receptor_v2_split[i])
74 else:
75 receptors.append(rec)

IndexError: list index out of range

@hajihajilala
Copy link

Hi xy441,
I have encountered this question. I check CellChat output dataframe and find "CD8 receptor" in the column "receptor", it's the reason error happened. I try to change "CD8 receptor" into "CD8A_CD8B1" in column "receptor" in the CellChat output. And then it's run complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants