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

Interoperability issues with anndata/scanpy-scripts #45164

Open
neoformit opened this issue Jan 10, 2024 · 1 comment
Open

Interoperability issues with anndata/scanpy-scripts #45164

neoformit opened this issue Jan 10, 2024 · 1 comment

Comments

@neoformit
Copy link
Contributor

The current build of scanpy-scripts has packaged anndata==0.7.6. This is causing issues in downstream Galaxy tools, since ebi-gxa/anndata_ops requires scanpy-scripts and gets this old anndata version. This means that it does not play nicely with other tools in the anndata suite, for example:

iuc/anndata_manipulate -> anndata==0.10.3
ebi-galaxy/anndata_ops -> anndata==0.7.8

An example of "does not play nicely" is that the output of anndata_manipulate will produce an error if read by anndata_ops, like:

Traceback (most recent call last):
  File "/mnt/tmp/job_working_directory/007/724/7724020/configs/tmp1jvzx33z", line 7, in <module>
    adata = sc.read('input.h5')
  File "/usr/local/lib/python3.9/site-packages/scanpy/readwrite.py", line 112, in read
    return _read(
  File "/usr/local/lib/python3.9/site-packages/scanpy/readwrite.py", line 713, in _read
    return read_h5ad(filename, backed=backed)
  File "/usr/local/lib/python3.9/site-packages/anndata/_io/h5ad.py", line 421, in read_h5ad
    d[k] = read_attribute(f[k])
  File "/usr/local/lib/python3.9/functools.py", line 877, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/usr/local/lib/python3.9/site-packages/anndata/_io/utils.py", line 183, in func_wrapper
    raise AnnDataReadError(
anndata._io.utils.AnnDataReadError: Above error raised while reading key '/layers' of type <class 'h5py._hl.group.Group'> from /.

ebi-galaxy/anndata_ops uses the latest scanpy-scripts==1.1.6, but the anndata version in scanpy-scripts is not pinned:

  • I'm not sure why this would lead to such an old anndata version, is it pinned in another dependency?
  • Would a rebuild of scanpy-scripts pull a newer anndata version?
  • Is there a way that we can solve the downstream problem, perhaps by declaring anndata>=0.8.0 as a requirement in the Galaxy tool?
@swbioinf
Copy link

swbioinf commented Jan 11, 2024

Just for more context on this. We are trying to have interoperability between two scanpy-based tools that are wrapped on the 'galaxy' platform.

There is an underlying conflict between old (<v0.8.0, early 2022) and current versions of the AnnData package - A tool using the old version can't read data generated with the newer version (and will generate the above error.) See scverse/scanpy#2297 and scverse/scanpy#1351 (comment)

The two scanpy-using tool wappers in question:

  1. 'iuc anndata_manipulate', which doesn't use scanpy-scripts, requires AnnData 0.10.3.
  2. 'ebi-gxa anndata_opts' - uses scanpy-scripts, which in turn requires AnnData, without version restriction.

So without any minimum requirements - tool number 2 via scanpy-scripts seems to be choosing an old version of AnnData (probaby the ancient ancient version of AnnData (0.6.11) on biocontainers https://biocontainers.pro/tools/anndata )

End result is that both tools work in isolation, but tool 2 crashes with anything saved with a more current anndata object.

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

2 participants