跳转到主要内容

用于简化CZ CELLxGENE Discover Census使用的API。有关API和项目的更多信息,请访问 https://github.com/chanzuckerberg/cellxgene-census/

项目描述

CZ CELLxGENE Discover Census

cellxgene_census 包提供了一个 API,以方便使用 CZ CELLxGENE Discover Census。有关 API 和项目的更多信息,请访问 chanzuckerberg/cellxgene-census GitHub 仓库

更多帮助

如需更多帮助,请在仓库中提交问题,或通过 soma@chanzuckerberg.com 联系我们。

如果您认为发现了安全漏洞,我们将非常感谢您的通知。请发送电子邮件至 security@chanzuckerberg.com

开发环境设置

  • 使用 venvconda 创建虚拟环境
  • cd 切换到此仓库的根目录
  • pip install -e api/python/cellxgene_census
  • 要安装 API 的 实验部分 所需的依赖项:pip install -e 'api/python/cellxgene_census[experimental]'
  • pip install jupyterlab
  • 测试它! 打开一个新的 jupyter 笔记本或 python 解释器并运行此代码
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

输出是一个满足我们查询标准并选择列的 pandas.DataFrame,包含超过 60 万个细胞

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]
  • 通过阅读 notebooks 中的教程来了解更多关于 Census API 的信息

项目详情


下载文件

下载适合您平台的文件。如果您不确定要选择哪个,请了解有关 安装包 的更多信息。

源代码分发

cellxgene_census-1.16.1.tar.gz (124.2 kB 查看哈希值)

上传时间 源代码

构建分发

cellxgene_census-1.16.1-py3-none-any.whl (54.9 kB 查看哈希值)

上传时间 Python 3

支持者