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

plot_intercellular_flows ERROR: #24

Open
capuddddd opened this issue Dec 13, 2024 · 2 comments
Open

plot_intercellular_flows ERROR: #24

capuddddd opened this issue Dec 13, 2024 · 2 comments

Comments

@capuddddd
Copy link

When I use the below code to for visualization, the following error occurs.

fs.pl.plot_intercellular_flows(adata,
                                flow_network = flow_network,
                                flowsig_network_key = 'flowsig_network',
                                align_mode = 'horizontal',
                                width_scale = 2.0,
                                x_margin_offset = 0.3,
                                y_margin_offset = 0.0,
                                ax=ax)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/public/home/99017/02users/07ca/00scRNA/Result_UCD1.3/Mammary_gland/final_rds/cellchat/flowsig/flowsig-main/flowsig/plotting/_plotting.py", line 126, in plot_intercellular_flows
    all_inflow_vars = [node for node in flow_vars if flow_var_info.loc[node]['Type'] == 'inflow']
  File "/public/home/99017/02users/07ca/00scRNA/Result_UCD1.3/Mammary_gland/final_rds/cellchat/flowsig/flowsig-main/flowsig/plotting/_plotting.py", line 126, in <listcomp>
    all_inflow_vars = [node for node in flow_vars if flow_var_info.loc[node]['Type'] == 'inflow']
  File "/public/home/99017/00envs/anaconda3/envs/flowsigenv/lib/python3.10/site-packages/pandas/core/generic.py", line 1577, in __nonzero__
    raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

What could be the cause of this problem? @axelalmet
Thanks!

@axelalmet
Copy link
Owner

Hello,

This usually occurs when there's a variable that's labelled as both an 'inflow' and 'outflow' variable. Did you happen to run FlowSig using cell-cell communication inference that included cell-cell contact interactions, e.g., something like CDH1-CDH1?

This issue has come up enough that in the next version of FlowSig, I will probably have a case that accounts for this.

Best wishes,
Axel.

@capuddddd
Copy link
Author

Thanks for your reply! i have checked my data, it does exist this kind of ligand and receptor, i will modify it and try it again

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