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

Add panel metadata to AnnData export #66

Closed
jwindhager opened this issue Oct 21, 2021 · 8 comments
Closed

Add panel metadata to AnnData export #66

jwindhager opened this issue Oct 21, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@jwindhager
Copy link
Contributor

... as variable annotations, as suggested by @ndamond

@jwindhager jwindhager added the enhancement New feature or request label Oct 21, 2021
@jwindhager jwindhager self-assigned this Oct 21, 2021
@jwindhager
Copy link
Contributor Author

Also, concatenate multiple images, similar to the CSV export?

@ndamond
Copy link

ndamond commented Oct 22, 2021

Also, the image metadata (currently exported as images.csv) could be exported to AnnData "observations".

jwindhager pushed a commit that referenced this issue Nov 1, 2021
@jwindhager
Copy link
Contributor Author

jwindhager commented Nov 5, 2021

Unfortunately, anndata currently does not support pandas' nullable data types (see scverse/anndata#628), which are required for panel/image metadata. We'll have to wait for this to be resolved, before panel/image metadata can be included in the anndata export.

@ivirshup
Copy link

ivirshup commented Nov 9, 2021

scverse/anndata#504 may be a better issue to track here

@jwindhager
Copy link
Contributor Author

While nullable ints/bools are now supported, pandas StringArray support (for nullable string columns) is still missing: scverse/anndata#679

@ivirshup
Copy link

@jwindhager how strong is your need for strings instead of categoricals? E.g. will you have repeated values in these columns?

@jwindhager
Copy link
Contributor Author

Thanks for checking in @ivirshup! Unfortunately, these cannot be expected to be categoricals. I'm currently implementing a workaround based on astype(str) (i.e., convert dtype("string") columns to dtype("O")) and leave it up to anndata to deal with it (I assume you're internally converting to categoricals - not the most efficient way I assume, but currently a good enough workaround I guess).

@ivirshup
Copy link

Hopefully that will work.

Alright, let me know if it doesn't. I'm still waiting for a better solution from pandas, but I think we could make this work given a use case.

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

3 participants