Skip to main content

Parse and read RDS files as Python representations

Project description

rds2py

Parse and construct Python representations for datasets stored in RDS files. rds2py supports a few base classes from R and Bioconductor's SummarizedExperiment and SingleCellExperiment S4 classes. This is possible because of Aaron's rds2cpp library.

The package uses memory views (except for strings) to access the same memory from C++ in Python (through Cython of course). This is especially useful for large datasets so we don't make multiple copies of data.

Install

Package is published to PyPI

pip install rds2py

Usage

If you do not have an RDS object handy, feel free to download one from single-cell-test-files.

from rds2py import as_summarized_experiment, read_rds

rObj = read_rds(<path_to_file>)

Once we have a dictionary representation of the RDS file, we can now build useful Python representations from these objects.

This rObj contains two keys

  • data: If atomic entities, contains the numpy view of the memory space.
  • attributes: Additional properties available for the object.

The package provides friendly functions to easily convert a few R representations to Python.

from rds2py import as_spase_matrix, as_summarized_experiment

# to convert an robject to a sparse matrix
sp_mat = as_sparse(rObj)

# to convert an robject to SCE
sce = as_summarized_experiment(rObj)

For more examples converting data.frame, dgCMatrix, dgRMatrix, dgTMatrix to Python, checkout the documentation.

Developer Notes

This project uses Cython to provide bindings from C++ to Python.

Steps to setup dependencies -

  • git submodules is initialized in extern/rds2cpp
  • cmake . in extern/rds2cpp directory to download dependencies, especially the byteme library

First one needs to build the extern library, this would generate a shared object file to src/rds2py/core-[*].so

python setup.py build_ext --inplace

For typical development workflows, run

python setup.py build_ext --inplace && tox

Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

rds2py-0.3.0.tar.gz (266.6 kB view details)

Uploaded Source

Built Distributions

rds2py-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

rds2py-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

rds2py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (315.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rds2py-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl (329.5 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

rds2py-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

rds2py-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

rds2py-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (315.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rds2py-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl (329.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

rds2py-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

rds2py-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

rds2py-0.3.0-cp39-cp39-macosx_11_0_arm64.whl (315.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

rds2py-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl (329.8 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: rds2py-0.3.0.tar.gz
  • Upload date:
  • Size: 266.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for rds2py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2e6d71fade460ecb49fa454527e2f8c9ce83319bac1a42f175f5a10fe65b077b
MD5 bc56f25c321d0d7f85f0c4fe0e98659e
BLAKE2b-256 0dcea59c474b2138bdd969367cd94e06b24f9104f94f54d67d27a6e46ddf4c6a

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 0131b1d89361c3a05f30d9cc7f871cd443a56ebd510e9ab1b8aebef219ec3ee0
MD5 44980e3f798102b1ccc7a405e039e325
BLAKE2b-256 4a690f902cf8c6ad29696d1c2347b9a610836256052e9b548b3c2b8928b5ffc0

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f9994c9dc6890c533bfb392a569ef418afe69ca1f9b9144fe22360e1b20a755
MD5 fb2082915239b18a0417505eeb82413b
BLAKE2b-256 c035136d839653af346a717ca3ab8724ac0d16510314c7a522959f20e073fa74

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf0144497c3d1621d1feb7d3a6cde23fa5f07ffa694e4763e32e51ffd60bd5f4
MD5 3d319b2f702558a7f9b0faead5e7f111
BLAKE2b-256 65e47e5556a366b41af181e34e932befe1fbd9a21fd2feb1bad7532fb4ad12a0

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 53a2a938c84a1ca9dd0143687cc50cf47453c6772fb3bf90703c34fa4fda0c7a
MD5 8c539a9928db9ad9339affaee716cb2a
BLAKE2b-256 3d8eb31d8bf39b225c78d1be392738165e510f72a5792f32409ad559bd2c1763

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d70d486efa733217dd7751012b745c1375c30140b06ba7a3ecaf323c5fa17fe4
MD5 f953087b123ae80aa61adb99de341f6c
BLAKE2b-256 b1b9f18aaf1abbcb6cd0803028eb98ac686fea389515d2dd99c03de313417cfb

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b25605709ea5f40f6220fc1602eb204f56f86cc788035aebd308248021976bf
MD5 a6e96d90c2adfb4a7d7d188e780e1b8e
BLAKE2b-256 8bec9cf6fbaeacf09fbd0b4a32dbddf60db40de75da55938b135ea7c5dc6eaff

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f29b37bec879f7a69b7ddcc2e169af2128d5ed18327abdec1a02a3d0bb2737ed
MD5 6d9de8fd2a3a918b00b98b043301ab66
BLAKE2b-256 586f9eb064488f3487188c08ff47e651bec9324a4c7ba9e57e406d3a1acbe2ac

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c3b3141eb5cba596be59721fef1b009c8fbb6bac1eada0af5b8b940f231004f3
MD5 0f28dbf4b8d2355cf77390c90e8bc12d
BLAKE2b-256 2ca4f5d73e1583f0af2b69a8561c4e5d32c4becc4152c37cf8607ec718226981

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 63132f983da6842254ac1010318bc1831532e4ab96033f1c839ff555c269deee
MD5 5e73f70c872669e6c86776e95e997b61
BLAKE2b-256 01c44a91675f6147053d5e1b62dd826f377f34fc4fd98bf58436d15fcffe96e2

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 050ad5e22399d1d80cc6e55d7196978da702ffed1ea093af07f55f3a81d366be
MD5 16a0fb6e9b82427fb6b869778232038d
BLAKE2b-256 409f3fa6d0d7d2037e1612e436574a8790115ee6fedffc7e49972b2391373b67

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1742c2aa628db8a69d14d3e224ec16f1ac8d5bd4e6cb002e1cd320e99660ffb
MD5 26500faa2faef1a72f72c4ff59661e22
BLAKE2b-256 acb54cf5d63f696dcfcc39f99495496d1f535e122f5a51d59cc7f2be7247c019

See more details on using hashes here.

File details

Details for the file rds2py-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3a9c5adc452bb88236c4807ff2d2834b8d12891c17391bfe5c9f786083a73763
MD5 bc10f71942f8f3259c5f4087a351fe17
BLAKE2b-256 2a9eaced696a10ba7e2f34a4246d7b227c9d2f77b0cc96f2166828a97bc40cc8

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