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
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 .
inextern/rds2cpp
directory to download dependencies, especially thebyteme
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file rds2py-0.4.2.tar.gz
.
File metadata
- Download URL: rds2py-0.4.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.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e34ca712d38297416447cfc5173c7a60dcd0805897e63bb66a3a9c3a3d743d2d |
|
MD5 | 881aee6d326a70776fd18d966dae27c2 |
|
BLAKE2b-256 | eda4b806f9a84e5ee13f3236fb9cf17516786fdfa6c6f8e94ed295bfce210f5e |
File details
Details for the file rds2py-0.4.2-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c88ff9feaaa7eff7e8e971566a0b2599ca63a34902a34ca22c6acfef94beba9 |
|
MD5 | 4d4d479a077ad60dbe76143ec80e1af3 |
|
BLAKE2b-256 | cd754c04ebb73cd3e3651caa398d9d9f1dbe5e3fbe4ae998c7f47ece806fb577 |
File details
Details for the file rds2py-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eefc6ea0b57ccb07b25568d3baba8c55ae851b98119da14dd9c7d0258f462f42 |
|
MD5 | bd643ec3f1d6b3ddec74a01a792f231f |
|
BLAKE2b-256 | 96879695179abd9a87218c8a0bf0167b2195e31a7c9e3d8f4b922b96e82b8f79 |
File details
Details for the file rds2py-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 322.3 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d548985b5842e20242e09ff78ec36369a73c815ecb92565294a0eb6c41fc0b0 |
|
MD5 | 3e7390d7d1933de2dcca5908764f81a6 |
|
BLAKE2b-256 | 874ea3e0ecf823628ce93850b442a6092c04e4b33fdfb00b86cfcc8af0786c55 |
File details
Details for the file rds2py-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 334.1 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 119b4b3904f5370554a2aff39df5b333a754736722a7c10dad04c680318735c4 |
|
MD5 | 23068e2e43c8441ec8e63f304483d3f1 |
|
BLAKE2b-256 | ff07a53e4810d622fd48fb1b42974dd7b011bee4ac4731fcc097e83e18fd1210 |
File details
Details for the file rds2py-0.4.2-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a5ef1993539749a10ab06408eaef88380394efccff697fa0defa25c2ab23334 |
|
MD5 | 304c2ca3b8ad09815dad96cb52fa9536 |
|
BLAKE2b-256 | 9750f3af216272ff46eb5d9dbf39791f1b99ae3346796cdea4999f261d52ac80 |
File details
Details for the file rds2py-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbcfbefdabceda215e3885ac82303cdd990385097c1cf74dd38f9c5d4190754f |
|
MD5 | dc9a2dbe898b6018f056ae75e9304bdc |
|
BLAKE2b-256 | 0de83d246a4ad64b9dfc9deed89c0e51889650c7d1c573aef9e46c910f2e5d77 |
File details
Details for the file rds2py-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 322.0 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ceb659b057f7eed38724468cffbbfcfacacbd4d1ac21515e38efc794aa2edcd |
|
MD5 | b2749ce6f2dc22ef5a8b6b178168a4a9 |
|
BLAKE2b-256 | 8a0b49ee171c7363854ec221cdf302255db3c6197d0a4eae6778919e4fef8a3d |
File details
Details for the file rds2py-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 333.8 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8167c420f060f6d7d1bf41b7d66904eb76c16b86a0259d01c4e0e5e38fce4348 |
|
MD5 | 370f11a95f6c43e2b332c284bb2f424c |
|
BLAKE2b-256 | d6b43cb6b4f311d9943c4b639b2678a11a0d01738cded667401a13f30d03f93d |
File details
Details for the file rds2py-0.4.2-cp39-cp39-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp39-cp39-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4f43a83ba82ce7fb93177014cafd2f7afcd943a2429e2726e34cc397327afb |
|
MD5 | d6707b9dbda4c449c5ff745d5bad4e47 |
|
BLAKE2b-256 | 2c027f65564beb0e68d5ad7fac2dd7f3d9194f0f857f4fd1a9e1e2e9bc3e4ace |
File details
Details for the file rds2py-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8527b8f0c5a779c28f7092b4854fcbd57c6c468b6a4bce74f1ed301cfe6385bb |
|
MD5 | 8487c841c4fbd0331ed08b7243670291 |
|
BLAKE2b-256 | 0caf83a68d270580389173e9e54c9ebd315798f364210a06fb84c92dbda0b19a |
File details
Details for the file rds2py-0.4.2-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 322.4 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 559bedded020573e237b18223fc7b4e23685dedf71bb90f4d43fe197e9712a4e |
|
MD5 | 4c5576e04b7d431e7358b0b93aa5c0f6 |
|
BLAKE2b-256 | c8360a8d825d77b10f9ddcd5bfd91e6c6a496fdc61b9f621c78135d1a33c5c40 |
File details
Details for the file rds2py-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 334.4 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f428fa2790e68eb038d304737dfa27357740eea462e185ba8bf0dc1ee073eee7 |
|
MD5 | 88bc5677f81bf5727a9fdc2edc45d4b8 |
|
BLAKE2b-256 | e5f9af484011560b038f0563a0c3f569a632037938c3b1b303b38dd35f1301b0 |
File details
Details for the file rds2py-0.4.2-cp38-cp38-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp38-cp38-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.8, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38147d21d6af9b986a1088d7badbd170d45b9ff82c52cef431971784bea1cc7a |
|
MD5 | 551722f5dd8c195f97fffa337679d51c |
|
BLAKE2b-256 | 62ae2d7cdd8669e5cf825a9243eccbcf692e02b88dfceaaa1c24f86de9112d78 |
File details
Details for the file rds2py-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ea4804c4a66e3715a6b63c0e2d3c85bcf13736bb0fd8a86cb93e106a02c6e6 |
|
MD5 | 21c643c7f7c808624c05535368bb99c8 |
|
BLAKE2b-256 | 50d962f9135fbef94174e0e16654490f0b3ab03d665824fbbe4c9195c378eed8 |
File details
Details for the file rds2py-0.4.2-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 321.9 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21c9ea8270ca498462b5c3e894f8218b3fe01317a6d6e968fb515a1f71d28882 |
|
MD5 | 8633fc670d6b74e45dd1e9c1753d8540 |
|
BLAKE2b-256 | 5ff09937d65f5c751e87a865f2db1f66fd615daada0d0d963af03b856ac68649 |
File details
Details for the file rds2py-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: rds2py-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 333.8 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a96e1381277d2af74b2540504dfe09235dbfababfe7ab612d3c5f5c77c97113 |
|
MD5 | 600d8296d137ece611071081e637d174 |
|
BLAKE2b-256 | 3e0b5f941553d68385b79fb2cb5dc6e1e2435a3ea771a7bc15da1582dc279ebf |