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 RangedSummarizedExperiment 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 RangedSummarizedExperiment, most methods especially slicing and accessors are inherited from the parent classes. 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.6.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.6.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: singlecellexperiment-0.6.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for singlecellexperiment-0.6.2.tar.gz
Algorithm Hash digest
SHA256 e66b695ac79c43354a40340cbe661113c4585ec17636e2e3d01741bfdfb113d9
MD5 5c367adad05a156e790de8fb492827da
BLAKE2b-256 e79f27355368d14ecd7458204f9ed266efa2b86fea1ff06cb26cf16c5f8e74e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for singlecellexperiment-0.6.2.tar.gz:

Publisher: publish-pypi.yml on BiocPy/SingleCellExperiment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file singlecellexperiment-0.6.2-py3-none-any.whl.

File metadata

File hashes

Hashes for singlecellexperiment-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb857938775f17f93a64ff3657babe022fd3d4b78482ffa13d2143b07734cd82
MD5 78efd78d46ab8a61b30f49bb2b553d2a
BLAKE2b-256 ddaa19fe359f0ee03c79773b55f64ec9de3038c6a357a4e8e61606d7a02baaee

See more details on using hashes here.

Provenance

The following attestation bundles were made for singlecellexperiment-0.6.2-py3-none-any.whl:

Publisher: publish-pypi.yml on BiocPy/SingleCellExperiment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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