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

How to construct the flow expression matrices? #10

Open
yixudong opened this issue Sep 12, 2024 · 4 comments
Open

How to construct the flow expression matrices? #10

yixudong opened this issue Sep 12, 2024 · 4 comments

Comments

@yixudong
Copy link

Dear Axel,
After The error(#6), I'm sorry I ran into the error again on the next run:
image
Whether this is caused by The cell-cell communication inference.csv?
I used Cellchat.object@net$prob as my inference.csv, lt look at :
image
We would very much appreciate your help!
Best wishes,
Yixudong.

@yixudong yixudong changed the title error in How to construct the flow expression matrices? Sep 12, 2024
@axelalmet
Copy link
Owner

axelalmet commented Sep 16, 2024

Hi Yixudong,

You're right, the issue is that FlowSig doesn't work with the direct probability matrices created by CellChat. To run FlowSig with CellChat analysis, I would generate the interaction data.frame using CellChat's subsetCommunication() method, as specified under the section of "Extract the inferred cellular communication network as a data frame" in the CellChat tutorial.

That is, you should then create df.net <- subsetCommunication(cellchat) and then save df.net as inference.csv.

Hope that helps!

@yixudong
Copy link
Author

Hi Axel, it worked, but when i run fs.pp.determine_differentially_flowing_vars(), it emerge a new error :
image
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'flowsig.preprocessing' has no attribute 'determine_differentially_flowing_vars' . I just updated figslow and his version is 0.1.1

@axelalmet
Copy link
Owner

Hi yixudong,

That's a mistake on my behalf. I'm very sorry about that! Try updating to 0.1.2 and going back to running:

fs.pp.determine_informative_variables(adata,  
                                    flowsig_expr_key = 'X_flow',
                                    flowsig_network_key = 'flowsig_network',
                                    spatial = False,
                                    condition_key = condition_key,
                                    control_key =  'Ctrl',
                                    qval_threshold = 0.05,
                                    logfc_threshold = 0.5)

The reason this is an error is that determine_differentially_flowing_vars is supposed to be an internal function that determine_informative_variables calls. I had mixed them up when revisiting the code.

Sorry again!

@wolfQK
Copy link

wolfQK commented Sep 25, 2024

Change the second line of flowsig/flowsig/preprocessing/init.py to:
from ._flow_preprocessing import subset_for_flow_type, filter_flow_vars, determine_differentially_flowing_vars, determine_spatially_flowing_vars, determine_informative_variables
This modification should resolve the issue. @axelalmet

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

3 participants