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.2.0.tar.gz
(22.3 kB
view details)
Built Distribution
File details
Details for the file dolomite_sce-0.2.0.tar.gz
.
File metadata
- Download URL: dolomite_sce-0.2.0.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fd19f0affe489ac4d30f28b46b1e70d6fd3cc85746a0d3e81de351de80fe605 |
|
MD5 | b567d32aecc3ee9368055db902dfbfcd |
|
BLAKE2b-256 | 68854cb34d41f32939235e4268888fae5b3b88b4eaaa2e013e86149f324606b7 |
File details
Details for the file dolomite_sce-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: dolomite_sce-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ca631783d86642f8d6762c8492d9f49b575146d943be0e30a5d78e8892c90bc |
|
MD5 | 332fe82a179ac60beb9cfe84cac5b1ee |
|
BLAKE2b-256 | 12cbfdf9a19980fa72c32d1913e940df4291a5d564cfe4977d4b02d00a801588 |