Skip to content

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

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

Open
itsjustnilay opened this issue Feb 19, 2025 · 0 comments

Comments

@itsjustnilay
Copy link

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?

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