Skip to main content

Container class for single-cell experiments

Project description

Project generated with PyScaffold PyPI-Server Unit tests

SingleCellExperiment

This package provides container class to represent single-cell experimental data as 2-dimensional matrices. In these matrices, the rows typically denote features or genomic regions of interest, while columns represent cells. In addition, a SingleCellExperiment (SCE) object may contain low-dimensionality embeddings, alternative experiments performed on same sample or set of cells. Follows Bioconductor's SingleCellExperiment.

Install

To get started, install the package from PyPI

pip install singlecellexperiment

Usage

The SingleCellExperiment extends RangeSummarizedExperiment and contains additional attributes:

  • reduced_dims: Slot for low-dimensionality embeddings for each cell.
  • alternative_experiments: Manages multi-modal experiments performed on the same sample or set of cells.
  • row_pairs or column_pairs: Stores relationships between features or cells.

Readers are available to parse h5ad or AnnData objects to SCE:

import singlecellexperiment

sce = singlecellexperiment.read_h5ad("tests/data/adata.h5ad")
## output
class: SingleCellExperiment
dimensions: (20, 30)
assays(3): ['array', 'sparse', 'X']
row_data columns(5): ['var_cat', 'cat_ordered', 'int64', 'float64', 'uint8']
row_names(0):
column_data columns(5): ['obs_cat', 'cat_ordered', 'int64', 'float64', 'uint8']
column_names(0):
main_experiment_name:
reduced_dims(0): []
alternative_experiments(0): []
row_pairs(0): []
column_pairs(0): []
metadata(2): O_recarray nested

OR construct one from scratch

from singlecellexperiment import SingleCellExperiment

tse = SingleCellExperiment(
    assays={"counts": counts}, row_data=df_gr, col_data=col_data,
    reduced_dims={"tsne": ..., "umap": ...}, alternative_experiments={"atac": ...}
)

Since SingleCellExperiment extends RangeSummarizedExperiment, most methods especially slicing and accessors are applicable here. Checkout the documentation for more info.

Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

singlecellexperiment-0.5.2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

SingleCellExperiment-0.5.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file singlecellexperiment-0.5.2.tar.gz.

File metadata

  • Download URL: singlecellexperiment-0.5.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for singlecellexperiment-0.5.2.tar.gz
Algorithm Hash digest
SHA256 15c1cd4d029cb64dc58b07c7010a0d6dac4bed1f79dc9f38b643cd6a38d726b7
MD5 82611316be1a4bacb555a0e95f0615d0
BLAKE2b-256 d6122d479c4bd79a1fec605b4f75fe9c3e2f5f2b1f7cd7492bf45bd79e94e0d1

See more details on using hashes here.

File details

Details for the file SingleCellExperiment-0.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for SingleCellExperiment-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fd7e6c432256493b28cd0977a4cb1ec20f880a0eb24e8e5091fde170a71efdc
MD5 c739759b462009d40f817971497b6278
BLAKE2b-256 c01554b49a625223431621fc821eabd585afda8210b84ba974394d985a38f7ee

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