You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-20
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,12 @@
4
4
5
5
# rds2py
6
6
7
-
Parse and construct Python representations for datasets stored in RDS files. `rds2py` supports various base classes from R, and Bioconductor's `SummarizedExperiment` and `SingleCellExperiment` S4 classes. ***For more details, check out [rds2cpp library](https://github.com/LTLA/rds2cpp).***
7
+
Parse and construct Python representations for datasets stored in RDS files. `rds2py` supports various base classes from R, and Bioconductor's `SummarizedExperiment` and `SingleCellExperiment` S4 classes. **_For more details, check out [rds2cpp library](https://github.com/LTLA/rds2cpp)._**
8
8
9
9
---
10
+
10
11
**Version 0.5.0** brings major changes to the package,
12
+
11
13
- Complete overhaul of the codebase using pybind11
12
14
- Streamlined readers for R data types
13
15
- Updated API for all classes and methods
@@ -18,7 +20,7 @@ Please refer to the [documentation](https://biocpy.github.io/rds2py/) for the la
18
20
19
21
The package provides:
20
22
21
-
- Efficient parsing of RDS files with *minimal* memory overhead
23
+
- Efficient parsing of RDS files with _minimal_ memory overhead
22
24
- Support for R's basic data types and complex S4 objects
23
25
- Vectors (numeric, character, logical)
24
26
- Factors
@@ -48,51 +50,61 @@ pip install rds2py
48
50
pip install rds2py[optional]
49
51
```
50
52
53
+
By default, the package does not install packages to convert python representations to BiocPy classes. Please consider installing all optional dependencies.
54
+
51
55
## Usage
52
56
53
57
If you do not have an RDS object handy, feel free to download one from [single-cell-test-files](https://github.com/jkanche/random-test-files/releases).
54
58
55
-
### Basic Usage
56
-
57
59
```python
58
60
from rds2py import read_rds
59
61
r_obj = read_rds("path/to/file.rds")
60
62
```
61
63
62
64
The returned `r_obj` either returns an appropriate Python class if a parser is already implemented or returns the dictionary containing the data from the RDS file.
63
65
64
-
## Write-your-own-reader
66
+
In addition, the package provides the dictionary representation of the RDS file.
67
+
68
+
```python
69
+
from rds2py import parse_rds
70
+
71
+
robject_dict = parse_rds("path/to/file.rds")
72
+
print(robject_dict)
73
+
```
74
+
75
+
### Write-your-own-reader
65
76
66
-
In addition, the package provides the dictionary representation of the RDS file, allowing users to write their own custom readers into appropriate Python representations.
77
+
Reading RDS files as dictionary representations allows users to write their own custom readers into appropriate Python representations.
67
78
68
79
```python
69
80
from rds2py import parse_rds
70
81
71
-
data= parse_rds("path/to/file.rds")
72
-
print(data)
82
+
robject= parse_rds("path/to/file.rds")
83
+
print(robject)
73
84
```
74
85
75
86
if you know this RDS file contains an `GenomicRanges` object, you can use the built-in reader or write your own reader to convert this dictionary.
76
87
77
88
```python
78
89
from rds2py.read_granges import read_genomic_ranges
0 commit comments