Skip to content

Commit

Permalink
Package based interoperability
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseDck committed Sep 4, 2024
1 parent 310c3ef commit c8289a3
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions slides/slides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,56 @@ exectute:

# Introduction

# File formats
1. How do you interact with a package in another language?
2. How do you make you package useable for developers in other languages?

We will be focusing on R & Python

# How do you interact with a package in another language?

1. File format based interoperability
2. In-memory interoperability

# How do you make your package useable for developers in other languages?

1. Package-based interoperability
2. Best practices

## Package-based interoperability
or: the question of reimplementation.

Consider the pros:
- Discoverability
- Can your package be useful in other domains?
- Very user friendly

Consider the cons:
- Think twice: is it worth it?
- It's a lot of work
- How will you keep it up to date?
- How will you ensure parity?

## Best practices
1. Work with the standards
2. Work with matrices, arrays and dataframes
3. Provide vignettes on interoperability

# File format based interoperability


# Calling Python from R and vice versa
or: in-memory interoperability

## Overview


reticulate:

1. Call Python in R
2. embed a Python session within your R session

basilisk allows managing Python environments within the BioConductor ecosystem


rpy2:

1. Call R in Python
Expand All @@ -53,25 +89,31 @@ rpy2:
- ensure that the method accepts this
- you need to be familiar with using & managing both environments
- data duplication
- you need to manage the environments

## accessing R from Python

rpy2
rpy2: an interface to R running embedded in a Python process




Jupyter notebooks:
- Use IPython magic interface
- most useful for matrices & arrays

e.g. `%%R -i input -o output`
e.g. `%%R -i input -o output` as the first line of the cell

## accessing R from Python
rpy2

- use anndata2ri: converts anndata objects to SingleCellExperiment

## accessing Python from R
reticulate
basilisk

# Package-based interoperability
or: the question of reimplementation


# Workflows

Expand Down

0 comments on commit c8289a3

Please sign in to comment.