Skip to main content

Save and load single-cell experiments in the dolomite framework!

Project description

Project generated with PyScaffold PyPI-Server Unit tests

Save and write SingleCellExperiments in Python

Introduction

The dolomite-sce package is the Python counterpart to the alabaster.sce R package, providing methods for saving/reading SingleCellExperiment objects within the dolomite framework.

Quick start

Let's mock up a SingleCellExperiment that contains reduced dimensions and alternative experiments,

from singlecellexperiment import SingleCellExperiment
import biocframe
import numpy

sce = SingleCellExperiment(
     assays={"counts": numpy.random.rand(1000, 200)},
     row_data=biocframe.BiocFrame(
          {"foo": numpy.random.rand(1000), "bar": numpy.random.rand(1000)}
     ),
     column_data=biocframe.BiocFrame(
          {"whee": numpy.random.rand(200), "stuff": numpy.random.rand(200)}
     ),
     reduced_dims={"tsnooch": numpy.random.rand(200, 4)},
     alternative_experiments={
          "very_useful_modality": SummarizedExperiment(
               {"counts": numpy.random.rand(100, 200)}
          )
     },
)

Now we can save it:

from dolomite_base import save_object
import dolomite_sce
import os
from tempfile import mkdtemp

path = os.path.join(mkdtemp(), "test")
save_object(se, path)

And load it again, e,g., in a new session:

from dolomite_base import read_object

roundtrip = read_object(path)
## Class SingleCellExperiment with 1000 features and 200 cells
##   assays: ['counts']
##   row_data: ['foo']
##   column_data: ['whee']

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

dolomite_sce-0.1.2.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

dolomite_sce-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file dolomite_sce-0.1.2.tar.gz.

File metadata

  • Download URL: dolomite_sce-0.1.2.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for dolomite_sce-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3a0bdb22dc93fe784daad213e3694d6ed44b46d946d38df08d4fae0e5af22300
MD5 b9bef5c718f39d67bc99c2731ca9d6b6
BLAKE2b-256 8c5d969daddfbfb3179acc31bf0bb44dd732c3863358e8cd0d3bf0f37b812e35

See more details on using hashes here.

File details

Details for the file dolomite_sce-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dolomite_sce-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a2a4548d3ad30c7947edc048c991b4a38a340a025f6260ed75fabf3de249d4a
MD5 1daad1aa1e0b4fed240ed20e471b793d
BLAKE2b-256 1d4260dc1f2aea68b361798b99243d5cccb0c9d091326b5d5c588fc3c6a4d9f1

See more details on using hashes here.

Supported by

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