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

spatialdm_global does not work with a list of specified index, pair_selection_matrix would change adata #6

Open
wyq977 opened this issue Jan 5, 2023 · 1 comment

Comments

@wyq977
Copy link
Contributor

wyq977 commented Jan 5, 2023

Hi I found out there's a bug in spatialdm_global

adata.uns['global_stat']['z']['st'] = globle_st_compute(adata)

For example, if there are 400 lr pairs after extract_lr, one select 10 pairs for computation.

User cannot specify specified_ind as in globle_st_compute(adata) would also be still 400 (or 400x400)

That would throw a error in calculation due to

adata.uns['global_stat']['z']['st'].shape != np.zeros(total_len).shape

Also in this function, it would change/remove the ligand, receptor and geneInter in adata. Namely, the changes to adata would NOT be local.

For example, if one only specify 2 pairs, after calculation, ligand, receptor and geneInter would be reduced to 2.

You have to re-run extract_lr to get the full list.

def pair_selection_matrix(adata, n_perm, sel_ind, method):

@wyq977 wyq977 changed the title spatialdm_global does not work with a list specified index, pair_selection_matrix would change adata spatialdm_global does not work with a list of specified index, pair_selection_matrix would change adata Jan 5, 2023
@wyq977
Copy link
Contributor Author

wyq977 commented Jan 5, 2023

I tried to fix the first problem in this commit 7bdcaa1

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

1 participant