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

[BUG] Problems with latest AnnData version #2706

Open
const-ae opened this issue Oct 24, 2024 · 0 comments
Open

[BUG] Problems with latest AnnData version #2706

const-ae opened this issue Oct 24, 2024 · 0 comments
Labels

Comments

@const-ae
Copy link

Describe the bug

Starting cellxgene launch ~/datasets/precancer_atlas/sce_small.h5ad with the latest version of AnnData (0.10.9) crashes because calling data.obs.reset_index(inplace=TRUE) (https://github.com/chanzuckerberg/cellxgene/blob/main/server/data_anndata/anndata_adaptor.py#L113) puts the object in to an inconsistent state.

When I install Anndata version 0.10.5 the problem disappears.

Output

/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/server/data_anndata/anndata_adaptor.py:241: UserWarning: Anndata data matrix is in float64 format not float32. Precision may be truncated.
  warnings.warn(
WARNING:root:Type float64 will be converted to 32 bit float and may lose precision.
WARNING:root:Type float64 will be converted to 32 bit float and may lose precision.
WARNING:root:Type float64 will be converted to 32 bit float and may lose precision.
WARNING:root:Type float64 will be converted to 32 bit float and may lose precision.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/server/data_anndata/anndata_adaptor.py", line 34, in __init__
    self._validate_and_initialize()
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/server/data_anndata/anndata_adaptor.py", line 202, in _validate_and_initialize
    self._create_schema()
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/server/data_anndata/anndata_adaptor.py", line 146, in _create_schema
    for layout in self.get_embedding_names():
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/server/data_anndata/anndata_adaptor.py", line 305, in get_embedding_names
    layouts = [key[2:] for key in self.data.obsm_keys() if type(key) is str and key.startswith("X_")]
                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/anndata/_core/anndata.py", line 929, in obsm_keys
    return list(self.obsm.keys())
                ^^^^^^^^^
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/anndata/_core/aligned_mapping.py", line 422, in __get__
    return self.construct(obj, store=getattr(obj, f"_{self.name}"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/anndata/_core/aligned_mapping.py", line 403, in construct
    return self.cls(obj, axis=self.axis, store=store)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/anndata/_core/aligned_mapping.py", line 297, in __init__
    super().__init__(parent, store=store)
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/anndata/_core/aligned_mapping.py", line 210, in __init__
    self._data[k] = self._validate_value(v, k)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ahlmanne/prog/experiments/cellxgene/.cellxgene/lib/python3.12/site-packages/anndata/_core/aligned_mapping.py", line 275, in _validate_value
    raise ValueError(msg) from None
ValueError: value.index does not match parent’s obs names:
Index are different

Attribute "inferred_type" are different
[left]:  string
[right]: integer

Version (please complete the following information):

  • Desktop: Macbook pro M3
  • Version: 1.3.0
@const-ae const-ae added the bug label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant