Skip to main content

Save and load summarized experiments in the dolomite framework!

Project description

Project generated with PyScaffold PyPI-Server Unit tests

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


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.1.1.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

dolomite_se-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file dolomite-se-0.1.1.tar.gz.

File metadata

  • Download URL: dolomite-se-0.1.1.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dolomite-se-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ae6aa335da810052ebc59a0717b9dcc2822409bd4304ebe93fb1ec72d0e449e
MD5 ff4c230813fdc6dbe09ea249d346ffe8
BLAKE2b-256 027e5fb2b545ddd5c6a4a744de7ccbe9bdb522e55ba0a3d7f8f5bf296ba8eecf

See more details on using hashes here.

File details

Details for the file dolomite_se-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dolomite_se-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dolomite_se-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de7271f894abd8e9d97004ae52c84a603d11358f74a5cb69283f37c18000c5cc
MD5 bb46aaec8562216ee63d3769564ffa97
BLAKE2b-256 782a4eca418861da0e60feaac6b18e71f90a89fa48e6ebcd05977b636219319e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page