Add a short description here!
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
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)]
),
col_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 stage_object, write_metadata
import dolomite_se
dir = "test"
meta = stage_object(se, dir, "mydata")
write_metadata(meta, dir)
print(meta["path"])
## mydata/experiment.json
And load it again, e,g., in a new session:
from dolomite_base import acquire_metadata, load_object
meta = acquire_metadata("test", "mydata/experiment.json")
reloaded = load_object(meta, dir)
## Class SummarizedExperiment with 1000 features and 200 samples
## assays: ['counts']
## row_data: ['foo']
## col_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-se-0.0.1.tar.gz
(21.6 kB
view details)
Built Distribution
File details
Details for the file dolomite-se-0.0.1.tar.gz
.
File metadata
- Download URL: dolomite-se-0.0.1.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfe17b03d2a8f2cbc39f8b0a8fd171ccb34c75cf250388b73673f2c675846351 |
|
MD5 | f22df5f59053012ccf44066210eaa9dc |
|
BLAKE2b-256 | c714e61fe24002a07363fac6970c58d47ad13c308842044b3a6db9cf732dd298 |
File details
Details for the file dolomite_se-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: dolomite_se-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.9 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 | d6650e934dee80e9c57aab87384252747b489e0351c0587552912ae1d5685a82 |
|
MD5 | 99a77c7aeae9df9024d312670c77d0a6 |
|
BLAKE2b-256 | f5b007e4010ec3d3ae26a7290ef3f45f855b244461df8e1577116dea2e2c591e |