Skip to main content

Python client for Cell-Annotation-Platform (CAP) GraphQL API.

Project description

Python client for Cell-Annotation-Platform GraphQL API

PyPI version

The Python package provides a simple interface to interact with the Cell Annotation Platform (CAP) GraphQL API. The package allows to search for datasets, cell labels metadata and get molecular profiles of cell types published on CAP.

Installation

pip install -U cap-sc-client

Basic usage

The main goal of this package is to provide an interace to access CAP datasets and cell annotation metadata (including marker genes, synonyms, rationales, etc.) via standard python tooling. The outputs are in the format pandas DataFrame, which could be converted to other formats (csv, JSON, etc.) if the user desires.

>>> from cap_sc_client import CapClient
>>> cp = CapClient()
>>> datasets = cp.search_datasets(limit=5, offset=0, organism=["Homo sapiens"])
>>> datasets.head()
     id                           name  cell_count                        project
0  1427  Skin fibroblasts   - Pan-d...    337376.0  {'id': '613', 'name': 'Pan...
1  1426  Skin fibroblast scRNA-seq ...    153546.0  {'id': '613', 'name': 'Pan...
2  1157  Single cell atlas of the h...     72788.0  {'id': '544', 'name': 'Sin...
3  1156  snRNA-seq of human retina ...   3177310.0  {'id': '544', 'name': 'Sin...
4  1154  snRNA-seq of human retina ...    691008.0  {'id': '544', 'name': 'Sin...
>>> labels = cp.search_cell_labels(limit=10, offset=0)
>>> labels[["full_name", "ontology_term_exists", "marker_genes"]]
             full_name  ontology_term_exists         marker_genes
0  cycling stromal ...                 True   [MKI67, TOP2A, C...
1  alveolar type 1 ...                 True          [PDPN, HOPX]
2    mesoderm 2 (ZEB2)                False                [ZEB2]
3          acinar cell                 True               [PRSS1]
4               neuron                 True               [STMN2]
5   smooth muscle cell                 True   [DES, CNN1, ACTA...
6        ciliated cell                 True               [FOXJ1]
7         Schwann cell                 True                 [MPZ]
8     pancreatic cells                False                [PDX1]
9            club cell                 True             [SCGB1A1]

There is also an MDSession class that allows users to interact with the molecular profiles of cell types within a specific dataset. However, this class requires users to be familiar with the CAP MD page.

For more examples, please refer to "examples" and the GitHub wiki for detailed documentation.

Documentation

Detailed documentation is available on GitHub Wiki.

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

cap_sc_client-1.0.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

cap_sc_client-1.0.1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file cap_sc_client-1.0.1.tar.gz.

File metadata

  • Download URL: cap_sc_client-1.0.1.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for cap_sc_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 67840e789c73fe0ab019b14e2e1531c10d84d239163a6c5e962797f2146e0524
MD5 ef3eda53ee8c7ba45a2aa321dd48636d
BLAKE2b-256 9a2b6d2b28ba00f9889fe2e593921be3ba8833e15eeeb9db91224dadac6c83aa

See more details on using hashes here.

File details

Details for the file cap_sc_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cap_sc_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 666bb973a8499a8d0a26b9e00badb74db5baff2219289ad46d8b8fd3d64eae2f
MD5 a67d5cdf1bf85f2664616147cb26640f
BLAKE2b-256 920061c20be8f1bbc47f3e4edf5830b0852e95b1326c36e1b0154bf495d65e62

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