Save and load single-cell experiments in the dolomite framework!
Project description
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
Release history Release notifications | RSS feed
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.0.tar.gz
(22.5 kB
view details)
Built Distribution
File details
Details for the file dolomite-sce-0.1.0.tar.gz
.
File metadata
- Download URL: dolomite-sce-0.1.0.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0548c6582c4b69f90838793d86ad291e3cac7ad0c09150596bd0feb090c20d6a |
|
MD5 | 6a79f7bcd756e8a48083c4a6fe89e347 |
|
BLAKE2b-256 | 9ef935fdb7371eccf730a09341e3fe94a7586a4c0dc56b20346ca33b324207b5 |
File details
Details for the file dolomite_sce-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: dolomite_sce-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b366e5fe18e76d46847f4ac3cdb0d97a52d8f4ae869ff4bebe5d274866dbc1 |
|
MD5 | dbb76425ceff1eb46d8fca74aa6c04e4 |
|
BLAKE2b-256 | c35ae9bb6cba57c464eaf727af2b32a1cfeb2697cb83870aa1f694cc4f78969d |