Skip to content

Commit

Permalink
test the R workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Feb 20, 2024
1 parent 3ecb9dc commit 8967476
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
packages: |
any::BiocManager
any::alabaster
any::scRNAseq
# - run: Rscript r_requirements.r

- name: Render
Expand Down
2 changes: 1 addition & 1 deletion chapters/interop.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Interop with R

The [rds2py](https://github.com/BiocPy/rds2py) package serves as a Python interface to the [rds2cpp](https://github.com/LTLA/rds2cpp) library, enabling direct reading of RDS files within Python. This eliminates the need for additional data conversion tools or intermediate formats, streamlining the transition between Python and R for seamless analysis.
The [rds2py](https://github.com/BiocPy/rds2py) package provides Python bindings to the [rds2cpp](https://github.com/LTLA/rds2cpp) library, enabling direct reading of RDS files within Python. This eliminates the need for additional data conversion tools or intermediate formats, streamlining the transition between Python and R for seamless analysis.

One notable feature is the use of memory views (excluding strings) to access the same memory from C++ in Python, facilitated through Cython. This approach is particularly advantageous for handling large datasets, as it avoids unnecessary duplication of data.

Expand Down
17 changes: 17 additions & 0 deletions chapters/workflow.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```{r}
library(scRNA-seq)
sce <- ZilionisLungData()
library(alabaster)
dir_path <- paste(getwd(), "datasets", sep="/")
saveObject(sce, path=paste(dir_path, "zilinoislung", sep="/"))
```


```{python}
from dolomite_base import read_object
obj = read_object("./datasets/zilinoislung")
print(obj)
```
7 changes: 4 additions & 3 deletions r_requirements.r
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# install.packages(c("BiocManager", "devtools"), repos='http://cran.us.r-project.org')
BiocManager::install(version = "3.18")
install.packages(c("BiocManager", "devtools"), repos='http://cran.us.r-project.org')
BiocManager::install(version = "3.18", ask=FALSE)

# install alabaster
BiocManager::install(c("alabaster"))
BiocManager::install(c("alabaster", "scRNAseq"))

0 comments on commit 8967476

Please sign in to comment.