Skip to main content

Parse and read RDS files as Python representations

Project description

Project generated with PyScaffold PyPI-Server Unit tests

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

r_obj = read_rds(<path_to_file>)

This r_obj holds a dictionary representation of the RDS file, we can now transform this object into Python representations.

rObj always contains two keys

  • data: If atomic entities, contains the NumPy view of the array.
  • attributes: Additional properties available for the object.

In addition, the package provides functions to convert parsed R objects into Python representations.

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.4.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

rds2py-0.4.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.4.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.4.0-cp311-cp311-macosx_11_0_arm64.whl (321.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rds2py-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl (333.0 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

rds2py-0.4.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.4.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.4.0-cp310-cp310-macosx_11_0_arm64.whl (320.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rds2py-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl (332.7 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

rds2py-0.4.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.4.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.4.0-cp39-cp39-macosx_11_0_arm64.whl (321.3 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

rds2py-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl (333.3 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: rds2py-0.4.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.7

File hashes

Hashes for rds2py-0.4.0.tar.gz
Algorithm Hash digest
SHA256 80e4e78bc4dfb66fe71bc8e992c09c08c619b8bafcd7c098a7388905e9700f46
MD5 1347fcc35a7ed6ac2c7e10563b8b5794
BLAKE2b-256 3364d3420fae904ab9632068ed3c9de6dba25098a98c5ab217add6568e57326a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 fb72ea63d798b068204c8072aac75c8bbbf8a1f550beac8410de3a5054818254
MD5 192bb99ce8b02d9355b334e17f0b632d
BLAKE2b-256 d4191574d46677fd317cc89e5d4d5bde25d4c28a2ae43eba0e3161824ce213b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1f42decef6ddcb50f7df189ae9b4d7a3b14e2dc34c8067e4b5ff70278e0dc85
MD5 35165706689d4d46eceb3e18981d6249
BLAKE2b-256 06b5e7019234763b5f9b72470d8dbb3659c7e8eda148808d7119fad67ea0f3a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 612de20b086718c32fdc2af90ac2804c64d354d919f9d1a8b6342601d54ac739
MD5 02e476710db52de6bf96177352a24f64
BLAKE2b-256 c54cfaf46a010258d86fcea6079116537c61b4996659647249518aecf94b422f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 12effd7126f2e94eca2a45a072e1e430242c488fad69c28adffdc439308a5444
MD5 afda3455dbdbf70986025dd485c13c2e
BLAKE2b-256 5b08c4a8412fff4c10695c7a60b1220c87658dc87b2f52d49d97ac11b84e5ef9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5b4f3cacab33317a505f1fb9b4f96725588c8bfe133bcafd13ef78ae87d46ddb
MD5 2e803089889309cbfd79c95bb5264360
BLAKE2b-256 66d6bdf1dd0e594ab5967462123527aa993d364b0be4049b5f8c412ee93a4f86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 732ddb19cfe60b6504cdb8559d1dd25bc00a8e6e3ed503028cd3ab4f254242cb
MD5 697c67bbec7db87cd1ff94b14e8b6809
BLAKE2b-256 2fde6f6992a7a814ef09e9300801c2aef3064cb787b0294fe487e91adea482ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 084904fd81101ec4c54606644a573ff5696af2c821af0c63a883898f15505b75
MD5 ffd56bb4b707c078ad1890d71b003bcd
BLAKE2b-256 8df0ac5d3717e4fc27a1ba2c647cf9e87c89ec8b121cfe9616243562558242a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a6b525d578fd7d6ae36418a12f5a0bc666cea2c090c4110711cb56b4327d527f
MD5 03f016ffa67517abf02117f212812a34
BLAKE2b-256 86138cf3ec6dc6d8b0227893bce93e328e7d44aa287c1a96e07f949d0943d3b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1b984a4ff834b04d8dcc7122a0a8c0b92535651cbc4b3e5daa50ca1d518b8d6a
MD5 8872efa5e72b440db2e20c826160700d
BLAKE2b-256 ebd8dd4b47e519e92505ad1b7bb0b34e5e9ff2e76ffa2c38b2f85d274683a772

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb525ad5841328c57df76b64ee429b67102cc2bc7c507839b69e874174a04dab
MD5 6adf986f3adde378943b4075b75c1465
BLAKE2b-256 3e0ba3eee1c2de83ed48e4042a1535ca8472548c72bee14bc6517ce603895e61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33904e44a217e1ebaf86eea0cf651718bac52d8ee7f43f654322d160955aed8a
MD5 dbc7a02b68906bb7d5f84bacbbf1036b
BLAKE2b-256 ee771b974ba81ccdf44eec8cc8b55838e5f59ad54afc4b0278f94e28861022b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 44c9d7fc53ee1fe018ba579d6147d76da04b8a164f03465f60fb066bedae865e
MD5 9aeae5f09204ee14c977087a878e0fa3
BLAKE2b-256 39544db96f7f667489dcb44d91f89e739c9237327981f8ee4b10abfa661ef18d

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