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

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

Uploaded Source

Built Distributions

rds2py-0.3.2-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.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (321.5 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rds2py-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl (333.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

rds2py-0.3.2-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.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (321.2 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rds2py-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl (333.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

rds2py-0.3.2-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.2-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.2-cp39-cp39-macosx_11_0_arm64.whl (321.7 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

rds2py-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl (333.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rds2py-0.3.2.tar.gz
Algorithm Hash digest
SHA256 01097e01b494336d2c721ba5d49f3dfb2664eb4bb28248e5f0b823bf8f6683bf
MD5 d21773beddb5a9a05bf819c3c0d688fa
BLAKE2b-256 d042cfcaa96f8bfbafa8ae0d09783907a89601c560e9a9afc99da4ad75cd1246

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b95487eae9526e3fbf3e2fea62b4c9ccbc821277b215204a2b039d5cf90dcb9c
MD5 ca33c8d00a3fbe76909af628953209c4
BLAKE2b-256 b68fa0db0782eb358e72973902b39764f6b23568bcb5f73c1c92126431d16161

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4cfa515a1c432f16846acdd4e3dbf25ea0ceec501c09a68511260fcbc2f9353f
MD5 4f9f8396bacc6890c5af20a6656d99bb
BLAKE2b-256 a60f44522bfaadfc71cbf080c3d64ab18c146af4715c148ec9434f92eb23a0c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44c95ed3292f9a2bb32a4de0d4f4f299682505bb641174d0aef5eb728ee4a976
MD5 3b79b107e6c2c82b399bb577e631bfd1
BLAKE2b-256 5daa641c16ba5874a153d70e93b1acac3a6cf1fa4a0ceb6acce204e5f0dcd07b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 77219416002656c303e42ac7012cfe33e477707a36a66e6f3394dc42c4b96592
MD5 c18179cf17f59aea242f2a427f130250
BLAKE2b-256 9a7ae9a1c698f0ab0213225ec18c96f3aa615ee41be9eea36af142462278c553

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 eec767fae399791bb5ab4c46eb8f827ae10d169d1635c897283ab4928a297ecf
MD5 7f64842ab9e27baf25e1c87ab1af1190
BLAKE2b-256 f58d970465d963244a7be324c8f5403fc674f51620265a2441cf1d4aabafc2d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 272d74c05f69d5d4ffca8211c5dccf83e18cb2d193e83c07d8d283ec47b8f865
MD5 4421fee84a50a78fb0314c45061206af
BLAKE2b-256 47933d906d39d59b054c1746279f42ad08040446b2acb667f66ce910dc16e5cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ddc1e4cbc9836ba91826c78bbd393301606d3aa0ae2772267cbbf08ba467e995
MD5 5aa899dd21b4b1a85d60eba4af52e868
BLAKE2b-256 767f6b86840bad4aae737c9c7eb9d3b2c1ade02b16556913a2abdc7f04c54c81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d150c12b637503b4e5e2846222cd7aeb4a9d8c384f4d54bc6160cf4b8f996a95
MD5 486bf4d0dacdebeb5e608ea6f78ba2b9
BLAKE2b-256 fad7c37270790f114633a738f6cd794f197a226f4a62cd91567f869781e4c6ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 fded7408d50e2b4df3d634253d8102bda4c272d0a416c3eea5a186e0a5363bab
MD5 10d57ab716b97cefb0865dc7dece72f9
BLAKE2b-256 8babe73161e7a379ab4d9fd1876a9442be75842cb1191781ae408298e7aeb700

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a1620d870c21ab6fd3b6420adc833639a5ecdcdf6797f58de9965526d7ccfa2
MD5 612510d501b3e92b41e76a6546adace7
BLAKE2b-256 94170efe0f9a91e38427fe20faeca6f8f538851eb7ecec62b5a0ae4aaa8647ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ff51fd25c2045eb9a0fe69503c807d280ca4260f53cac5f9d451ea2c9ea8b490
MD5 028a69c6101d5d94c9b0825c5b3f3ff1
BLAKE2b-256 11b34294ba9fe7a00f8c974883f39d409c437f293d40e079060c4d5b6727ddfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rds2py-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ee7149e404c19ffa7b2a25b3a9aa5b7eb46a44b93cc2aca687da203c3b09f234
MD5 bdb4b9b3d53c7faf511fab486004403c
BLAKE2b-256 703a40e4bfedd4c0fadf2050e3679ffb314090d3a08438be73bb845f1fa8951b

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