Skip to content

ValueError in milo.count_nhoods: Length of values does not match length of index #55

Description

@itsjustnilay

Description

When running milo.count_nhoods on my adata object, I encountered a ValueError indicating that the length of values does not match the length of the index.

My code:

d = 30
k = 50
sc.pp.neighbors(adata, n_neighbors=k, n_pcs=d)
milo.make_nhoods(adata, prop=0.1)
milo.count_nhoods(adata, sample_col="sample")

Error Message

ValueError: Length of values (5251) does not match length of index (5185)

My number of number of nonzero nhood indices (adata.obs["nhood_ixs_refined"] != 0).sum()), which is 5251 does not match the shape of nhoods matrix (adata.obsm["nhoods"].shape) :(80422, 5185).

Varying n_neighbors and n_pcs also leads to mismatch, albeit of varying proportions.

Can you please let me know how I can troubleshoot?

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions