Skip to content

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

Open

Description

@wyq977

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):

Activity

  1. 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[/+] on Jan 5, 2023
  2. wyq977 commented on Jan 5, 2023

    @wyq977
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions