Save and load summarized experiments in the dolomite framework!
Project description
Save and load SummarizedExperiments in Python
Introduction
The dolomite-se package is the Python counterpart to the alabaster.se R package,
providing methods for saving/reading SummarizedExperiment
or RangeSummarizedExperiment
objects within the dolomite framework.
All components of the SummarizedExperiment
- assays, row data and column data - are saved to their respective file representations,
which can be loaded in a new R/Python environment for cross-language analyses.
Quick start
Let's mock up a SummarizedExperiment
:
import summarizedexperiment
import biocframe
import numpy
se = summarizedexperiment.SummarizedExperiment(
assays={ "counts": numpy.random.rand(1000, 200) },
row_data=biocframe.BiocFrame(
{ "foo": numpy.random.rand(1000) },
row_names = ["gene" + str(i) for i in range(1000)]
),
column_data=biocframe.BiocFrame(
{ "whee": numpy.random.rand(200) },
row_names = ["cell" + str(i) for i in range(200)]
)
)
Now we can save it:
from dolomite_base import save_object
import dolomite_se
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 SummarizedExperiment with 1000 features and 200 samples
## assays: ['counts']
## row_data: ['foo']
## column_data: ['whee']
This also works for RangeSummarizedExperiment
objects storing row_ranges
to the specified path.
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
Built Distribution
File details
Details for the file dolomite_se-0.1.3.tar.gz
.
File metadata
- Download URL: dolomite_se-0.1.3.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d984e62757a83484557e167896c61df0b29c5590f9ef35d1f1986a3fd4b950 |
|
MD5 | 53a33aa6b361cd43171e21fc8de72ef4 |
|
BLAKE2b-256 | 004fe72d602be9ec322c610ab24697a4ed65740c04831720ad94fa0c0cdcd58c |
File details
Details for the file dolomite_se-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: dolomite_se-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19dc18477b5890db0ad21fab25f6b0f699f07ff64a237a1c0b09bc4e096f198a |
|
MD5 | 2f9ade69220a7e3de0662d2373b8378b |
|
BLAKE2b-256 | 8b011c0acf162be652fd351767458619a1fecbb05fd1c8d0b9b94c788e6baf3b |