Open mshirazi opened 3 years ago
Hmm, @ivirshup any idea why that might happen?
Looks like self._uns['neighbors']
is a R vector for some reason.
I'm not sure I get what needs to happen for this bug to come up. When did self._uns['neighbors']
become an R vector? Is there a mini-reproducer for this?
I've managed to reproduce the error with the paul dataset: after importing and activating all the packages in python and R, just running
import scanpy.datasets as scd
adata_paul = scd.paul15()
%%R -i adata_paul
print('test')
sc.pp.highly_variable_genes(adata_paul, flavor='cell_ranger', n_top_genes=4000)
print('\n','Number of highly variable genes: {:d}'.format(np.sum(adata_paul.var['highly_variable'])))
# Calculate the visualizations
sc.pp.pca(adata_paul, n_comps=50, use_highly_variable=True, svd_solver='arpack')
sc.pp.neighbors(adata_paul)
sc.tl.tsne(adata_paul, n_jobs=12) #Note n_jobs works for MulticoreTSNE, but not regular implementation)
sc.tl.umap(adata_paul)
sc.tl.diffmap(adata_paul)
sc.tl.draw_graph(adata_paul)
%%R -i adata_paul
print('test')
First one works, second one throws an error. Also tried running this after:
adata_paul.uns['neighbors']['connectivities'] = adata_paul.obsp['connectivities']
adata_paul.uns['neighbors']['distances'] = adata_paul.obsp['distances']
del adata_paul.obsp
%%R -i adata_paul
print('test')
And it throws the same error. Not sure if the problem in these mini-examples is all of the steps I cut out, or if that's the proper way to get rid of a field, but it seemed to work when I checked what was in adata_paul
.
Hi, I had the same problem as you reported above. I have no idea how to change my Anndata. I wanna know whether you solve this error and how you pass it?
Hi, I've been running through the sc-tutorial using the most recent versions of Scanpy and AnnData (anndata 0.7.4 & scanpy 1.6.0 & anndata2ri 1.0.5). I ran into an issue when trying to run the Slingshot code (similar to this issue on the sc-tutorial Github: https://github.com/theislab/single-cell-tutorial/issues/49). It's also similar to issue #50 but the error is different, and I never activate
numpy2ri
. It's not a problem with the location of the graph data in adata either, since I get the same error with a test script, and even get the same error before I start the subsetting. When I runI get the error
I tried running the example code
which worked without any warning messages, so I don't think it's a problem with importing and activating the anndata2ri package. I tried backtracking to see when the error started appearing, since when I try pulling
adata
into R right after I create it, it doesn't throw any errors. This exact error message appears after trying to use adata in R in the following part of the tutorial:but not right after running combat
However, I do get the following warning message when testing using R with adata right after the ComBat batch correction:
It runs error free right before the ComBat batch correction.
Let me know if there's any other information that would help, and thanks in advance!