{"id":21028,"library":"cellxgene-census","title":"cellxgene-census","description":"Python API to facilitate access to and analysis of the CZ CELLxGENE Discover Census, a curated collection of single-cell RNA-seq data. As of v1.17.0, requires Python 3.10-3.12. Released monthly.","status":"active","version":"1.17.0","language":"python","source_language":"en","source_url":"https://github.com/chanzuckerberg/cellxgene-census","tags":["single-cell","gene-expression","biology","soma","tiledb"],"install":[{"cmd":"pip install cellxgene-census","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Backend storage engine for Census data","package":"tiledb","optional":false},{"reason":"SOMA API over TileDB","package":"tiledbsoma","optional":false},{"reason":"AnnData object creation","package":"anndata","optional":false}],"imports":[{"note":"Function is at package level, not in experiment submodule","wrong":"from cellxgene_census.experiment import open_soma","symbol":"open_soma","correct":"from cellxgene_census import open_soma"},{"note":"Moved to top-level in v1.7+","wrong":"from cellxgene_census.anndata import get_anndata","symbol":"get_anndata","correct":"from cellxgene_census import get_anndata"},{"note":"Class is in experiment submodule","wrong":"from cellxgene_census import CensusExperiment","symbol":"CensusExperiment","correct":"from cellxgene_census.experiment import CensusExperiment"}],"quickstart":{"code":"from cellxgene_census import open_soma, get_anndata\n\nwith open_soma(census_version='2023-12-01') as census:\n    adata = get_anndata(\n        census=census,\n        organism='Homo sapiens',\n        measurement_name='RNA',\n        var_value_filter='feature_id in %(var_list)s',\n        var_value_filters={'var_list': ['ENSG00000161798', 'ENSG00000188229']}\n    )\n    print(adata.shape)","lang":"python","description":"Open latest stable Census version (year-month-day string) and fetch a subset of data for select genes."},"warnings":[{"fix":"Pin to a specific version string or use the 'latest' alias, but be aware that 'latest' may change under you.","message":"Census versions are date-stamped (e.g., '2023-12-01') and older versions are periodically retired. Always specify a valid, recent version or use 'latest' with caution.","severity":"breaking","affected_versions":"all"},{"fix":"Update calls: replace `X_name='counts'` with `X_layers=['counts']` and `obs_value_filter` with `obs_coords`.","message":"The `cellxgene_census.get_anndata` API underwent changes in v1.7: the 'X_name' parameter was renamed to 'X_layers' and 'obs_value_filter' became 'obs_coords'. Old code will raise TypeError.","severity":"deprecated","affected_versions":"<1.7"},{"fix":"Always open with `open_soma(mode='r')` unless you explicitly need to modify the Census (very rare).","message":"The Census uses TileDB arrays; concurrent writes are not allowed. Multiple processes opening the same Census for writing will corrupt data.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use a more recent census_version string (e.g., '2023-12-01' or later) or omit the argument to use the default latest.","cause":"Census version has been deprecated and the underlying data was removed from the remote server.","error":"tiledb.cc.TileDBError: [TileDB::Query] Error: Cannot read from non-existent fragment"},{"fix":"Check available columns: `census['census_data']['homo_sapiens'].var['RNA'].colnames` to find valid column names.","cause":"The var_value_filter references a column name that doesn't exist in the var dataframe for that organism/measurement.","error":"KeyError: 'feature_id not found in index'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}