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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dolomite_se-0.3.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file dolomite_se-0.3.0.tar.gz.

File metadata

  • Download URL: dolomite_se-0.3.0.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dolomite_se-0.3.0.tar.gz
Algorithm Hash digest
SHA256 33a89c9c57522c29010a13e8c7ce50e6db4910c1278865528b51cdeb375b5d3e
MD5 6aaadc795463beb672cfa57d8d2687bc
BLAKE2b-256 b7b3db182abd2c0781bad72c162f8fd24e0b4017517dab1693afa51cd97e74ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dolomite_se-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dolomite_se-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0aef8d4c95d5727b06fa5976b6be12575eb106cf981e696650e8cfd006f5324
MD5 0965525cd18f6313d7ed977cf1ca3d95
BLAKE2b-256 e9ba56c33f4a5ede0a58b44981ff73ea442c59a1688b84dd6c30c1f008b3a1aa

See more details on using hashes here.

Supported by

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