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

Update h5ad datatype #17574

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

pavanvidem
Copy link
Member

A small fix to the h5ad shape metadata. Recently, found an issue setting the metadata of an anndata object as part of this PR tests: galaxyproject/tools-iuc#5740
Surprisingly, in all these years, we did not encounter a dataset with this particular case of setting metadata.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-actions github-actions bot added this to the 24.1 milestone Mar 1, 2024
@bernt-matthias
Copy link
Contributor

Can you show me where this is used in the linked PR. Could not find it...

Surprisingly, in all these years, we did not encounter a dataset with this particular case of setting metadata.

Metadata is just used in very few tools.

@pavanvidem
Copy link
Member Author

pavanvidem commented Mar 4, 2024

Some tests from the preprocessing tool (planemo/galaxy) are failing currently to set the metadata. If the same Python code is run outside Galaxy, they are working fine. For a quick test, try to upload this h5ad file to a Galaxy server. The upload will fail, despite the fact that it is a valid file h5ad file. Reading the same file using anndata.read_h5ad or scanpy.read_h5ad outside of Galaxy is working.

@pavanvidem
Copy link
Member Author

Maybe my previous comment was not clear. I edited it.
ping @bernt-matthias

Copy link
Contributor

@bernt-matthias bernt-matthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a unit test over here: https://github.com/galaxyproject/galaxy/tree/dev/test/unit/data/datatypes? Seems that you already have a test case (or is it a large file)?

Should not be to complicated with inspiration from other data types, e.g. here.

@@ -1565,7 +1565,7 @@ def _layercountsize(tmp, lennames=0):
# Shape we determine here due to the non-standard representation of 'X' dimensions
shape = anndata_file["X"].attrs.get("shape")
if shape is not None:
dataset.metadata.shape = tuple(shape)
dataset.metadata.shape = (int(shape[0]), int(shape[1]))
elif hasattr(anndata_file["X"], "shape"):
dataset.metadata.shape = tuple(anndata_file["X"].shape)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess an analogous change should be applied here, or?

@bernt-matthias bernt-matthias self-assigned this May 14, 2024
@jdavcs jdavcs modified the milestones: 24.1, 24.2 May 20, 2024
@jdavcs
Copy link
Member

jdavcs commented May 20, 2024

Bumped to 24.2 for now. We can merge it into 24.1 though since this is a bug and/or a datatype fix.

@jdavcs jdavcs changed the title update h5ad datatype Update h5ad datatype Jun 13, 2024
@mvdbeek
Copy link
Member

mvdbeek commented Nov 12, 2024

@pavanvidem do you still want to get this in ? Can you address the comments ?

@mvdbeek mvdbeek removed this from the 24.2 milestone Nov 12, 2024
@pavanvidem
Copy link
Member Author

I will try to write tests in coming days. If it cannot wait, it is fine to remove from the next release.

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

Successfully merging this pull request may close these issues.

4 participants