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
I'm trying to run the tutorial in Jupyter notebook. I ran into the situation where I can successfully install and load Seurat within jupyter after running %load_ext rpy2.ipython. However, if I first run anndata2ri.activate() before loading the extension, then I get the following error when I attempt to load in the Seurat library.
%%R
library(Seurat)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/miniconda3/envs/bio/lib/python3.10/site-packages/rpy2/rinterface_lib/conversion.py:179, in _get_cdata(obj)
178try:
--> 179 cdata = obj.__sexp__._cdata
180exceptAttributeError:
AttributeError: 'numpy.str_' object has no attribute '__sexp__'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
lab/Ithaka/E1 scRNAseq analysis/integrate.ipynb Cell 4 line 1
----> get_ipython().run_cell_magic('R', '', 'library("Seurat")\n')
File ~/miniconda3/envs/bio/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2493, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2491 with self.builtin_trap:
2492 args = (magic_arg_s, cell)
-> 2493 result = fn(*args, **kwargs)
2495 # The code below prevents the output from being displayed
2496 # when using magics with decorator @output_can_be_silenced
2497 # when the last Python token in the expression is a ';'.
2498 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):
File ~/miniconda3/envs/bio/lib/python3.10/site-packages/rpy2/ipython/rmagic.py:935, in RMagics.R(self, line, cell, local_ns)
...
182'to map it to one: %s'%repr(obj))
183else:
184 cdata =cls(obj)
ValueError: Not an rpy2 R object and unable to map it to one: 'value'
Any idea what might be the issue? Also are there alternative ways of invoking anndata2ri within the Jupyter notebook without needing to globally activate it before loading the extension?
Thanks!
The text was updated successfully, but these errors were encountered:
Also are there alternative ways of invoking anndata2ri within the Jupyter notebook without needing to globally activate it before loading the extension?
Hi,
I'm trying to run the tutorial in Jupyter notebook. I ran into the situation where I can successfully install and load Seurat within jupyter after running
%load_ext rpy2.ipython
. However, if I first runanndata2ri.activate()
before loading the extension, then I get the following error when I attempt to load in the Seurat library.Any idea what might be the issue? Also are there alternative ways of invoking anndata2ri within the Jupyter notebook without needing to globally activate it before loading the extension?
Thanks!
The text was updated successfully, but these errors were encountered: