Skip to main content

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/

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cellxgene_census-1.17.0.tar.gz (124.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cellxgene_census-1.17.0-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

File details

Details for the file cellxgene_census-1.17.0.tar.gz.

File metadata

  • Download URL: cellxgene_census-1.17.0.tar.gz
  • Upload date:
  • Size: 124.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cellxgene_census-1.17.0.tar.gz
Algorithm Hash digest
SHA256 934f55dbc1124d8929e440362af204c6a09668587b26dbfeefe17d8dce0b6e9d
MD5 5aa6889aaa7c7fd45d6c77d739f7be7a
BLAKE2b-256 cf64820b2e3b690c41536fd94c4154cc7553b9e075ff0ed544929ad29627e2cc

See more details on using hashes here.

File details

Details for the file cellxgene_census-1.17.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cellxgene_census-1.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c63449f2cfd694d5b2d67690cd9f3873136c36ac5018390e1ba6565b04b83aed
MD5 1150dbdfc45b29845fbd6a83286f5301
BLAKE2b-256 37bd5c8053260a951bbffb26ab9e837fc5ac3cac1c9250e3b739aa49b8a225a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page