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

Problem introduced by 0.7.5.1 #6

Open
orenbenkiki opened this issue Mar 22, 2021 · 4 comments
Open

Problem introduced by 0.7.5.1 #6

orenbenkiki opened this issue Mar 22, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@orenbenkiki
Copy link

I have an AnnData object which contains a sparse matrix in a layer.
This is accessible from R in anndata 0.7.5, but the data is returned as NULL in 0.7.5.1.
I can replicate the issue by switching between the two installed versions of anndata w/o changing anything else in the environment.

@rcannood
Copy link
Member

rcannood commented Mar 22, 2021 via email

@orenbenkiki
Copy link
Author

My sample file is >20M compressed (>50M uncompressed). Don't know if the size has anything to do with the issue. Since it is >10M, I can't attach it here. I uploaded it to Google Drive:

https://drive.google.com/file/d/137p_KZ83NuG8hTP8SFMj5HgIQS5eOXhS/view?usp=sharing

The data in question is adata$layers$downsampled. It is a sparse matrix in 0.7.5 and NULL in 0.7.5.1.

Let me know if that works and when I can delete it from there.

@rcannood
Copy link
Member

Aha, I see! Thanks for the file, I managed to download it.

The issue is that in anndata 0.7.5, the anndata._core.aligned_mapping.Layers Python classwas being transformed into a list, which somewhat limited its usability. In anndata 0.7.5.1 I made the switch to having a separate R6 class for the Layers Python class, causing the aforementioned issue.

One solution would be to simply use adata$layers[["downsampled"]] instead.

I'm considering dynamically creating new active fields for each of the layers inside of the anndata object, so you can use the anndata$layers$downsampled again. This may or may not be a good idea. Let me think about it for a bit :)

@orenbenkiki
Copy link
Author

Hmmm, didn't occur to me to try [['downsampled']] instead of $downsampled. That's a reasonable workaround, although I'll miss the simpler form.

@rcannood rcannood added the enhancement New feature or request label Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants