cellxgene-census

API to facilitate the use of the CZ CELLxGENE Discover Census. For more information about the API and the project visit https://github.com/chanzuckerberg/cellxgene-census/

MIT 37 个版本 Python >=3.10
安装
pip install cellxgene-census
poetry add cellxgene-census
pipenv install cellxgene-census
conda install cellxgene-census
描述

CZ CELLxGENE Discover Census

The cellxgene_census package provides an API to facilitate the use of the CZ CELLxGENE Discover Census. For more information about the API and the project visit the chanzuckerberg/cellxgene-census GitHub repo.

For More Help

For more help, please file a issue on the repo, or contact us at soma@chanzuckerberg.com.

If you believe you have found a security issue, we would appreciate notification. Please send email to security@chanzuckerberg.com.

Development Environment Setup

  • Create a virtual environment using venv or conda
  • cd to the root of this repository
  • pip install -e api/python/cellxgene_census
  • To install dependencies needed to work on the experimental portion of the API: pip install -e 'api/python/cellxgene_census[experimental]'.
  • pip install jupyterlab
  • Test it! Either open up a new jupyter notebook or the python interpreter and run this code:
import cellxgene_census

with cellxgene_census.open_soma() as census:

    cell_metadata = cellxgene_census.get_obs(
        census,
        "homo_sapiens",
        value_filter = "sex == 'female' and cell_type in ['microglial cell', 'neuron']",
        column_names = ["assay", "cell_type", "tissue", "tissue_general", "suspension_type", "disease"]
    )
    cell_metadata

The output is a pandas.DataFrame with over 600K cells meeting our query criteria and the selected columns:


The "stable" release is currently 2023-12-15. Specify 'census_version="2023-12-15"' in future calls to open_soma() to ensure data consistency.

                assay        cell_type                 tissue tissue_general suspension_type disease     sex
0        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
1        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
2        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
3        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
4        Smart-seq v4  microglial cell  middle temporal gyrus          brain         nucleus  normal  female
...               ...              ...                    ...            ...             ...     ...     ...
607636  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
607637  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
607638  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
607639  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female
607640  microwell-seq           neuron          adrenal gland  adrenal gland            cell  normal  female

[607641 rows x 7 columns]

  • Learn more about the Census API by going through the tutorials in the notebooks
版本列表
1.18.0 2026-06-24
1.17.0 2025-04-02
1.16.2 2024-10-07
1.16.1 2024-09-10
1.16.0 2024-09-09
1.15.0 2024-07-11
1.14.1 2024-06-05
1.14.0 2024-05-28
1.13.1 2024-05-08
1.13.0 2024-04-03
1.12.0 2024-03-28
1.11.1 2024-03-13
1.11.0 2024-03-12
1.10.2 2024-02-13
1.10.1 2024-02-05
1.10.0 2024-02-02
1.9.1 2023-12-13
1.9.0 2023-12-08
1.8.0 2023-11-20
1.7.0 2023-10-25
1.6.0 2023-09-07
1.5.1 2023-08-08
1.5.0 2023-08-06
1.4.0 2023-07-28
1.3.1 2023-07-20
1.3.0 2023-06-30
1.2.1 2023-06-17
1.2.0 2023-06-07
1.1.0 2023-05-31
1.0.2 2023-05-23
1.0.1 2023-05-10
1.0.0 2023-05-03
1.0.0rc4 2023-05-03
1.0.0rc3 2023-05-03
1.0.0rc2 2023-05-01
1.0.0rc1 2023-04-27
0.13.0 2023-04-04