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

positive mask commented out + other questions #4

Closed
dbdimitrov opened this issue Nov 30, 2022 · 3 comments
Closed

positive mask commented out + other questions #4

dbdimitrov opened this issue Nov 30, 2022 · 3 comments

Comments

@dbdimitrov
Copy link

dbdimitrov commented Nov 30, 2022

Hi,

Congrats for the well-timed and efficient tool!

I wanted to ask in a previous version you had a positive local mask implemented, which is now commented out:

#adata.uns['local_z_p'] = np.where(pos.T == False, 1, adata.uns['local_z_p'])

What is the reasoning for this?

Also, were the correlations between analytical and permutation-based local p-values calculated before or after applying the mask?

Thanks in advance for your response!

Daniel

@dbdimitrov
Copy link
Author

dbdimitrov commented Dec 2, 2022

Last point, you introduce local bivariate Moran's I which is really cool, yet I noticed that you are missing m_squared in your formula
https://en.wikipedia.org/wiki/Moran%27s_I
and instead you scale as in global morans I, any reason for that?

Do we interpret the local moran's I in a way similar to z-scores, given that it does not seem to be bound betwen -1 and +1.

Finally, you suggest using raw data for local_r scores, but z-score type normalization with raw counts would be very susceptible to outliers, what would be the reasoning behind using raw?

Please do not hesitate to correct me if I'm misunderstanding.

Daniel

@dbdimitrov dbdimitrov changed the title positive mask commented out positive mask commented out + other questions Dec 2, 2022
@leeyoyohku
Copy link
Collaborator

@dbdimitrov Hi Daniel. Thanks for your interest in SpatialDM. Positive masks are common practice in Moran statistics, for which the reason is to avoid negatively-correlated hits.
For the purpose of SpatialDM, we'd better implement the positive mask. We may have accidentally uploaded the commented version which we used to test correlations internally.
The high local stat correlation in our manuscript is the result of positive mask implementation. I checked our internal test results of correlation. Without the positive mask, it seems there will be a lot of false positive hits under permutation mode, leading to lower correlations with the analytical approach.
We have fixed this in version 0.0.5, in which everything is wrapped up into one anndata object. Should be easier for you to explore:)

@dbdimitrov
Copy link
Author

Thanks for the answer

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