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 plot differentially flowing signals? #8

Open
changqinglu opened this issue Sep 9, 2024 · 1 comment
Open

How to plot differentially flowing signals? #8

changqinglu opened this issue Sep 9, 2024 · 1 comment

Comments

@changqinglu
Copy link

Dear Author,

I have used your example dataset, burkhardt21, for analysis, and I performed variable filtering with the following code:
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)

After the analysis, I visualized the results with the following:
fs.pl.plot_differentially_flowing_signals(
adata = adata,
condition_key = 'Condition',
pert_key = 'IFNg',
var_type = 'inflow',
flowsig_expr_key = 'X_flow',
flowsig_network_key = 'flowsig_network',
qval_threshold = 0.05,
logfc_threshold = 0.5,
label_lowqval = True
)
image
image

My question is: does this visualization show only the filtered differential variables, excluding the ones below the thresholds? In your paper, Fig. 4b and Fig. 4c included data below the threshold values. How did you keep those data? Also, why are the differential inflow and outflow signal results in my analysis quite different from yours?
I am looking forward to your response! Thank you!

@axelalmet
Copy link
Owner

axelalmet commented Sep 9, 2024

Hi changqiuliu,

This is a really good question! What's happened is that actually, after running fs.pp.determine_informative_variables, FlowSig has already removed the non-differentially flowing variables that will be considered for analysis. If you want to plot the differentially flowing variables and the non-significant variables originally constructed, try running something like:

fs.pl.plot_differentially_flowing_signals(
adata = adata,
condition_key = 'Condition',
pert_key = 'IFNg',
var_type = 'inflow',
flowsig_expr_key = 'X_flow',
flowsig_network_key = 'flowsig_network_orig',
qval_threshold = 0.05,
logfc_threshold = 0.5,
label_lowqval = True
)

That is, all of the preliminary variables are stored in adata.uns['flowsig_network_orig'].

However, while I do expect the logQ values to change (as the number of comparisons has changed), it's a little weird that the log fold changes seem to change as well. I'll look into this...

To give context, the code is really based on the volcano plot found here.

Hope that helps,
Axel.

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