I have an rds file that contains a Seurat RS4 object. I try to run
result = pyreadr.read_r('P1.seur.rds')
And get that the file contains an unrecognized object. I realize that I can't just load in the object like this and know that there are other tutorials on working with RS4 objects, but I'm not sure how to load in the file in the first place so I can use rpy2's functions to turn it into a Python dataframe. How can I load in the object so I can work with it? Thanks!
What about reading the rds file with rpy2? Unlike pyreadr
it will use R's own reader.
from rpy2.robjects.packages import importr
base = importr('base')
obj = base.readRDS('./foo.rds')