Save and load MultiAssayExperiments in Python
Introduction
The dolomite-mae package is the Python counterpart to the alabaster.mae R package,
providing methods for saving/reading MultiAssayExperiment objects within the dolomite framework.
All components of the MultiAssayExperiment - column_data, sample map and experiments - 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 MultiAssayExperiment:
from multiassayexperiment import MultiAssayExperiment
from singlecellexperiment import SingleCellExperiment
from summarizedexperiment import SummarizedExperiment
import biocframe
import numpy
x = numpy.random.rand(1000, 200)
x2 = (numpy.random.rand(1000, 200) * 10).astype(numpy.int32)
sce = SingleCellExperiment(
{"logcounts": x, "counts": x2},
main_experiment_name="aaron's secret modality",
row_data=biocframe.BiocFrame(
{"foo": numpy.random.rand(1000), "bar": numpy.random.rand(1000)},
row_names=["gene_sce_" + str(i) for i in range(1000)],
),
column_data=biocframe.BiocFrame(
{"whee": numpy.random.rand(200), "stuff": numpy.random.rand(200)},
row_names=["cell_sce" + str(i) for i in range(200)],
),
)
se = SummarizedExperiment(
{"counts": numpy.random.rand(100, 200)},
row_data=biocframe.BiocFrame(
{"foo": numpy.random.rand(100), "bar": numpy.random.rand(100)},
row_names=["gene_se_" + str(i) for i in range(100)],
),
column_data=biocframe.BiocFrame(
{"whee": numpy.random.rand(200), "stuff": numpy.random.rand(200)},
row_names=["cell_se" + str(i) for i in range(200)],
),
)
mae = MultiAssayExperiment(experiments={"jay_expt": sce, "aarons_expt": se})
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)
Metadata
Release files for dolomite-mae 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dolomite_mae-0.2.0.tar.gz | 23.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dolomite_mae-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.2 kB
Release files / dolomite_mae-0.2.0.tar.gz
| Download URL | dolomite_mae-0.2.0.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e7ea191b2bd780e6a7d23f1d7d787b61e19dc073fd78b35b54805540724f22d
|
|
BLAKE2b-256 checksum How to use checksums |
52a41e006c2cbf4a9c2d14367df070633fdf1eb4904b82964fbc3240902791df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / dolomite_mae-0.2.0-py3-none-any.whl
| Download URL | dolomite_mae-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
395711177d4336e2fdd06dd982b66c66ed6dbd9497602d193eff15fd77990b7a
|
|
BLAKE2b-256 checksum How to use checksums |
8477badaeec11ff7db9b9dd682a848827da1c6de1fdd02c113ca431b637a1599
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for dolomite-mae 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.