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

Subset HDF5AnnData? #189

Open
SNOL2 opened this issue Oct 30, 2024 · 4 comments
Open

Subset HDF5AnnData? #189

SNOL2 opened this issue Oct 30, 2024 · 4 comments

Comments

@SNOL2
Copy link

SNOL2 commented Oct 30, 2024

Hi, is it possible to subset HDF5AnnData? I tried adata[adata$obs['label']=='int_label',] and encounterd the error "object of type 'environment' is not subsettable".
Thanks in advance!

@lazappi
Copy link
Collaborator

lazappi commented Oct 31, 2024

Subsetting a HDF5AnnData would be difficult as it is directly linked to a file that we would need to (temporarily) modify. I would need to check if it's possible to do that in Python but I suspect not. If you want to subset your data you will need to convert it (or at least the part you want) into an in-memory format. In fact, HDF5AnnData isn't really designed for users to interact with directly but that's another conversation.

There should probably be a nicer error message when people try to subset though as I can see people trying to do that.

@SNOL2
Copy link
Author

SNOL2 commented Oct 31, 2024

Fine. Thanks for your answer!

@rcannood
Copy link
Collaborator

rcannood commented Nov 8, 2024

@lazappi We could implement an AnnDataView class, so that we can subset AnnData objects. Wdyt?

@lazappi
Copy link
Collaborator

lazappi commented Nov 11, 2024

I'm not sure that helps for the file-backed interfaces. I would probably check what Python let's you do and try to replicate that.

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

3 participants