ITADN

failure in `get_anndata` when querying for tissue and cell type metadata

#1419Closedklkeys 创建于 2025-08-25
bug
K
klkeyscommented
## Describe the bug the schema doesn't seem to match what is documented using `cellxgene-census==1.17.0` ## To Reproduce this fails ```python obs_filter=None var_filter="tissue_general in ['brain', 'heart', 'lung'] and cell_type in ['neurons', 'glia'] and is_primary_data == True" with cellxgene_census.open_soma(census_version="2025-01-30") as census: adata = cellxgene_census.get_anndata( census=census, organism="Homo sapiens", obs_value_filter=obs_filter, var_value_filter=var_filter, obs_column_names=["tissue", "tissue_general", "cell_type", "donor_id", "sex", "disease"], ) print(data) ``` with error ```bash tiledbsoma._exception.SOMAError: SOMAError: 'Column tissue_general does not exist in schema' ``` incidentally the [example from the doc](https://chanzuckerberg.github.io/cellxgene-census/cellxgene_census_docsite_quick_start.html#obtaining-a-slice-as-anndata) works (with the deprecation warning about `column_names`: ```python with cellxgene_census.open_soma() as census: adata = cellxgene_census.get_anndata( census = census, organism = "Homo sapiens", var_value_filter = "feature_id in ['ENSG00000161798', 'ENSG00000188229']", obs_value_filter = "sex == 'female' and cell_type in ['microglial cell', 'neuron']", column_names = {"obs": ["assay", "cell_type", "tissue", "tissue_general", "suspension_type", "disease"]}, ) ``` output of `print(adata)`: ```python AnnData object with n_obs × n_vars = 796426 × 2 obs: 'assay', 'cell_type', 'tissue', 'tissue_general', 'suspension_type', 'disease', 'sex' var: 'soma_joinid', 'feature_id', 'feature_name', 'feature_type', 'feature_length', 'nnz', 'n_measured_obs' ``` ## Expected behavior with `cellxgene-census==1.17.0` I expected the query to yield an AnnData object with obs metadata columns ```python ["tissue", "tissue_general", "cell_type", "donor_id", "sex", "disease"] ``` ## Environment - Machine: Apple Macbook Pro 16" Nov 2024 - OS: macOS Sequoia 15.5 - Software versions: ```bash anndata 0.12.2 cellxgene-census 1.17.0 numba 0.61.2 numpy 2.2.6 pandas 2.3.1 pyarrow 18.1.0 scanpy 1.11.4 scipy 1.16.1 tiledbsoma 1.17.1 ``` ## Additional context Add any other context about the problem here.
关闭于 2025-08-25 3 条评论