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.1.tar.gz
(22.5 kB
view details)
Built Distribution
File details
Details for the file dolomite-sce-0.1.1.tar.gz
.
File metadata
- Download URL: dolomite-sce-0.1.1.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 | bddd1a1a69a135a858ca10ce4c573a9f195078ba6bc963f14efe40d1c4dd384a |
|
MD5 | 696b6e76a89b4f27417824c37b8c58b1 |
|
BLAKE2b-256 | 85adf4f0c70ec38856df6f4f69365b9d74f741506f01dd287e258be858651f1f |
File details
Details for the file dolomite_sce-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: dolomite_sce-0.1.1-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 | ec92907d69f4b954fc1550993e3bd837f39c495d0fc6c639cad00c5d3fdb2b17 |
|
MD5 | 30c783b514cad1dda1a72293ee7dc242 |
|
BLAKE2b-256 | 1e06ba8e87c5a2ba0fe49237c4ce69f6f736f205def0fe4dc4cf55defec072d6 |