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

Uploaded Source

Built Distributions

rds2py-0.4.1-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.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (321.1 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rds2py-0.4.1-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.1-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.1-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.1-cp310-cp310-macosx_11_0_arm64.whl (320.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rds2py-0.4.1-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.1-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.1-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.1-cp39-cp39-macosx_11_0_arm64.whl (321.3 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 macOS 10.9+ x86-64

rds2py-0.4.1-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.1-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.1-cp38-cp38-macosx_11_0_arm64.whl (320.8 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

rds2py-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl (332.7 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: rds2py-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 afa20c15bfac3e2d2b46b94360bf4bbe1a280202c7c4a2bd27c14011f229005c
MD5 0955f86f53ffcc47ff3c74686d88e0c4
BLAKE2b-256 41a38687758d043f8fa85b137f44f75cd7ee22cf48f5b1767ad366b0e4ccd384

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b6fd50c03df76c0480f25d45b4aed2d6ed6f924144fc6c09ba6efa1b54085a83
MD5 55a3e395e183da1cc94f12bd4f368298
BLAKE2b-256 4ccb3c9dc7ff70956a45c7ff1b3d345bbcd14bbee266ec25e3006e5d28b1982e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff0288d414f10d0e0b98f9239cb8925c75b17039e973435a4092be9e997a0c3f
MD5 cb478e0a5998a76df59f2a9296d9f1b9
BLAKE2b-256 95cabb17c13f6e8dba1590d27316671b9a04444af9a5968c11990a1be6647989

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afc737a3754b770bedb3e7967f06c92348f1c7bf3ffa10eee086f79ec49d80d5
MD5 5fbe0e3c35243ebec24add8e4376fe2b
BLAKE2b-256 de45fb91eac36eccb2d382a7d89c1175da0d0e35e57622417bde1701246d7d7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 37340b921967dbae7b921d22dbfcf9b8759b3673a0b3a4ae0edcdcadf5cff373
MD5 20c465960610687b4fa0fb3709866f5b
BLAKE2b-256 d1c0ec4890cb5ebcc58aa0c1077e67b1957162e54f3eb7f1f07f6750aab66ddf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 cd771f2393e91bb54ae6cecf48d5f687b91b1093102e044ed442dda087f926f9
MD5 ee5e3624173708745502f61593c4ad01
BLAKE2b-256 bca27eb7ea209e4f225a1d0ddcb4aea5d802795af365e452682f0a57e9e49b4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b879c794b758b6c82ab87c2eb035a17ad047b5ed71754756fa94eb48bf82f16b
MD5 326cfc76ec462bc1ddcb7cfdca2e0588
BLAKE2b-256 7956381c994594caab5f5827e69ed2c962962ad0b9742180f7dc14b1644d9aa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 acec5f61dbcd33443a4f3f13c87a30c4200a5ff9ff45351550bc0e348711d0e0
MD5 92d3d7cd2605df5734d7478fd4a648aa
BLAKE2b-256 eb2b8eb642fdf3f07d619d6c5cfe2447a4059a84ad26a35b8fdeb2e7f43eef7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b9a6e8a8ddfdab2c4e93cf612c07606b45f77a60f6da4eafc53b14eb809f9ac7
MD5 cb2374ad69cc78296455b2bc55776428
BLAKE2b-256 cea83dc6eb358a2e97e497b39f2da10a1a7557fbafe71e258e98fb9b0a6877f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 9cc9e1e6d5680e00377296e08b1596b2ef1181787b3abfb36be6cadcbe3ca8fd
MD5 ceb86e12219bc18f4a086e7674a3549e
BLAKE2b-256 f30984d0b7f70b4973c31997e6b47d4cdcc03c62838a8cd8267858048c55b494

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4c5bce1e7a485179d02a6c806fc26e55dedd77c8f85de63d3dd5657a168e852
MD5 cf14981b5134630d95a58f505b4af612
BLAKE2b-256 b3fdaa26241e1271b6ac833a8741e0e8ca8457af21954d7c8e946438245b6cc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 282a351fb4509a1f24dbe3113cd3c58ba01f18baf1416dd8830c458f6d85c689
MD5 e9d3dbf7edfb9999488219cc24c37b7e
BLAKE2b-256 3007c0a7c34a43effc869286a3745125e9e790024699d50f5ade7523249232f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2ff129aa503028f0119238490cdcb7a01e892e474e99f755468875849cfe5225
MD5 230bea276eb0774404dcd4001dcf3d02
BLAKE2b-256 0fff4495b6973a06eb79813e5c45ebf2a4f2e1ab1972bae9cefa8f3fe2b58121

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1b1360e7ede58bc07ce778b486136388654c90a9a16adb812f7979c6cf872b67
MD5 d657f23b2e0edde1459e83a4f5ce4c86
BLAKE2b-256 b8cdba919a04fd3f8e2c7ae9befaff1170df18e54f4d5d80a5526bb139c7ac92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c2e2f4e6f06e99f98f0a04db6192166fab8858c248408d9fdc16cedf0cbafd0
MD5 ca0b3129d176aad5357ebcc3b214c8a1
BLAKE2b-256 b818dcf5af16a09774aabea637e056f3b30b3f7157127cf0c0ad37df27ae2afd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e363baa847eb3c4531749f2be75fd746bfb09801132dc775924924e67dfb961
MD5 6fa6cad9d64341a9c0229c2339532b34
BLAKE2b-256 af85aae5241d9fd8b6781a2428ce7812a9835f83d6d1554805a501f98bac1498

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eca326b8daddf9cc323a638d0ac0d042347b27a5ac12aa1625d4702c72e9783b
MD5 d4649f86e67d6be108590aceb7544aa2
BLAKE2b-256 5b6d4e13da618a0979e76fadea9cb22b8907c9e2cfdaa5e7bb6f5a89396a1fad

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