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

Uploaded Source

Built Distributions

rds2py-0.4.3-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.3-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.3-cp311-cp311-macosx_11_0_arm64.whl (315.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rds2py-0.4.3-cp311-cp311-macosx_10_9_x86_64.whl (326.8 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

rds2py-0.4.3-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.3-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.3-cp310-cp310-macosx_11_0_arm64.whl (315.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rds2py-0.4.3-cp310-cp310-macosx_10_9_x86_64.whl (326.4 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

rds2py-0.4.3-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.3-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.3-cp39-cp39-macosx_11_0_arm64.whl (316.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

rds2py-0.4.3-cp39-cp39-macosx_10_9_x86_64.whl (326.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

rds2py-0.4.3-cp38-cp38-musllinux_1_1_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

rds2py-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

rds2py-0.4.3-cp38-cp38-macosx_11_0_arm64.whl (314.6 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

rds2py-0.4.3-cp38-cp38-macosx_10_9_x86_64.whl (325.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rds2py-0.4.3.tar.gz
Algorithm Hash digest
SHA256 624e3d0b4fe40ed6fdab97b39975b6128bc6a62b17d7bf1a4747a98a69d727af
MD5 22c9e8a2542f1036f72b5df183b12f0f
BLAKE2b-256 9d71bbdb1e6fbc2039fbf5ebc4ceb53adc8c8a1a872aef9797bbb735f23d0fc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 c18494718b603a43dbb3e80fa8a9b3c29146f37c804715526f01c77284beb2e2
MD5 0a82eb6b5243c91473fee238b44490fe
BLAKE2b-256 a5b648bf19b7132f675c60f1d72385084137746653bddf42a5c943c79e8f366e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2405079365cc3adf4ef3fa783a6aeed100d3cf736256b5ae630bae259af7a548
MD5 17e94ad8e567034e7fef4340e0a8c39a
BLAKE2b-256 758d653cd85524207f4c74a56f5dd3b166e753d97686a7507e0741765a840b1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fff17f904f74457838967d16379aff06bef99164ff6a276c597b2546de8f7233
MD5 b118ea37a23bf5661d5e3b3a65f1c03d
BLAKE2b-256 6d0decdb09d17b24ae7ff5b0006a06b2bec430efec2b1a242a1b2d96036ce443

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e4fab5771dfb4b653b2ef2b8d94526bab13e409fbf3abb0b9d1673aec5b707fd
MD5 366ce99b990b9c7c8cd019dd8186cae7
BLAKE2b-256 f15ae8ac3d84d53091be739bc64e1470e0527f72a62acf8c17fc835fdc05b933

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 e364d8663a8055833ee2ee6d9ea808534886c6e32d25a8b95ef7613ee99b1d66
MD5 91de9dcbb7756b35c5144e4b418d59f5
BLAKE2b-256 4f56f1154413ab82ce0bdc10b6b254b550001b62a4ff469c4d4560a8c7a9dbfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2a69713aee88ee6677a14d5d71f905f2819e30b32fecaa170e446d44b8adcf9
MD5 b801629443924858ada3b96dcce2497d
BLAKE2b-256 16ef00e056d53a99856b05da5540bc0b463df6843034402ff5ab4d5699d3bc39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c85d23c0b1d8b8244e3271f075d6ee78045809f0d303e51d4af75f835df5592f
MD5 b7b5eefabbfce7b7c00638aba5cd100a
BLAKE2b-256 af9bb7947dc7b4ba957c2c9ba4aaabb0823ab932256d141557cfe13232a8b7f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a00c8ecc7ea183b547364beb8eb3baae686393dbc5d509e2d5913be433ae240b
MD5 83fa95430932196aa89fbe99a61369d7
BLAKE2b-256 61e2ef39a5b58d636448b667153ea535dbc37f5e215381475ac2ffede9c6b6d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1cd0d61067bf0abd7f3bdc49b602934cbe92e66d72179115f248a85f84912d75
MD5 c1f5ec368cb5066703934604011b5fc5
BLAKE2b-256 126de02a9695d03f9f5f0360201ff889d8e5e86e2a197e55719549cc953c58a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 efa1565d86c505165dc2c566b476d22da78f804de85d28a15af712d6b8913ab0
MD5 b41ac72567eee35c104d8d2790a86c3f
BLAKE2b-256 d6402f9cd3c22a69f893fee738fb66846899df66f75e647b7170499077e067dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 929a689c3472ed1079533d0bb208de7d25a3d8ac05a2c4a8c50e6642922b55b5
MD5 0d3ffa2e612641e9ce32f6807805ee3b
BLAKE2b-256 0b629405c5b155eea70929d52973cc875e871e494a56b12b98a75ee8762cf9bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fe75bdc79675fbec6c4b926ce9331c28a7c1024ad5e9c7b2f5f16b55f581e44e
MD5 26c247cf61c1e53d1ee58290f1abc5c5
BLAKE2b-256 a8581c6a3fdf7942cd4d72a9f753002c54f4c2e7a4770725364d5f49a9e826b4

See more details on using hashes here.

File details

Details for the file rds2py-0.4.3-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.4.3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ae69cd76b54e7acca5f8d7309e6b9a086b1a09f0f67c0b5e8ea767ae39952aa2
MD5 16d113ea810233e7b5c9a8249bd75928
BLAKE2b-256 1b625b70e282308bdf7b73eee7994c40d0bc9acd7df0f32f4482459d68152f43

See more details on using hashes here.

File details

Details for the file rds2py-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8dcdee6b1d0be062545d62c69f7ac0449fea261232a3fb181b61bf089a1697f1
MD5 9902a400d828eb97a581c197e0eeab05
BLAKE2b-256 4e56cf83adeb8325dd47b97abece9504dfa9d2837a555e2c6029968ec7439a86

See more details on using hashes here.

File details

Details for the file rds2py-0.4.3-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rds2py-0.4.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b5f8004e00fb079ea204202d105448be1b096bfc0bd11675abd9e5e2d206506
MD5 fdc1b9a06627cdaf22301e4928f93dc7
BLAKE2b-256 f60a33b82a4d7193e71196b0de8b6c0ce860e2a663523be5986513d0fd3f65f8

See more details on using hashes here.

File details

Details for the file rds2py-0.4.3-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rds2py-0.4.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 723591bf121ee84bb127307d7b12a505e3e2c0cfb986261dc2459388bde1df00
MD5 bc075278b5decbaea0b257b68bd4c4e9
BLAKE2b-256 c35315f6f8105a310082e10114f243c5f217b04214f148d5d05e7a9dbb30e2ad

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