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

Warn when anndata.concat join=outer fails because of a mismatch of layers #1286

Closed
pakiessling opened this issue Jan 5, 2024 · 1 comment · Fixed by #1291
Closed

Warn when anndata.concat join=outer fails because of a mismatch of layers #1286

pakiessling opened this issue Jan 5, 2024 · 1 comment · Fixed by #1291

Comments

@pakiessling
Copy link

Please describe your wishes and possible alternatives to achieve the desired result.

I just had something similiar to this happen:

import scanpy as sc, anndata as ad
print(sc.__version__, ad.__version__)
>1.9.6 0.10.4
pbmc = sc.datasets.pbmc68k_reduced()
pbmc1 = pbmc[:,:300].copy()
pbmc2 = pbmc[:,300:].copy()
pbmc1.layers["test"] = pbmc1.X.copy()

joined = ad.concat([pbmc1, pbmc2], join="outer",axis=1)
>IndexError: indices are out-of-bounds

And it took me a while to figure out that the problem was the outer join in combination with the layer mismatch.
Would it be possible to warn the user, that that is the problem?

@ivirshup
Copy link
Member

I can replicate. Thanks for the bug report!

Interesting that it doesn't happen when axis=0....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants