Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPy2 Refactor #21

Open
8 of 9 tasks
JoshLoecker opened this issue Sep 1, 2022 · 0 comments
Open
8 of 9 tasks

RPy2 Refactor #21

JoshLoecker opened this issue Sep 1, 2022 · 0 comments
Labels
priority:normal state:in-progress This is being worked on subsystem:python Relates to Python files subsystem:R Relates to R files type:development This is an issue with MADRID backend

Comments

@JoshLoecker
Copy link
Member

Description

Implementation of the r2py package is not great for the following reasons

  1. When a file is imported (import ...), the entirety of the "linked" R file is imported as well. This causes slow imports
  2. It is impossible to use any of the files outside of the Jupyter environment. Object Oriented Programming is not possible in this case

Fixes

To fix this, it would be ideal to place the r2py code into its own class, capable of loading any R file required. A possible function signature could appear as follows:

from rpy2.robjects.packages import importr
from rpy2.robjects.packages import SignatureTranslatedAnonymousPackage

class LoadRModule:
    def __init__(r_file_name: str):
        # Load the R file with r2py
    def call_func(function_name: str):
        # Call the requested R function

Impacts

The following Python files are currently impacted

  • Cluster RNASeq
  • Cluster Sources
  • Disease Analysis
  • Generate Counts Matrix
  • Instruments
  • Merge Xomics
  • Proteomics Gen
  • RNASeq Gen
  • RNASeq Preprocess
@JoshLoecker JoshLoecker added priority:normal type:development This is an issue with MADRID backend state:in-progress This is being worked on subsystem:python Relates to Python files subsystem:R Relates to R files labels Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:normal state:in-progress This is being worked on subsystem:python Relates to Python files subsystem:R Relates to R files type:development This is an issue with MADRID backend
Projects
Status: Open
Development

No branches or pull requests

1 participant