We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I'm running into an issue in the very first step sq.gr.spatial_neighbors, whenever delaunay is set to True.
sq.gr.spatial_neighbors
delaunay
True
sq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, n_neighs = 15, library_key= "sample") works, but sq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, delaunay = True, library_key= "sample") crashes.
sq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, n_neighs = 15, library_key= "sample")
sq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, delaunay = True, library_key= "sample")
The full error message:
>>> sq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, delaunay = True, library_key= "grid") Traceback (most recent call last): File "/home/mpohl/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc return self._engine.get_loc(casted_key) File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc File "index.pyx", line 173, in pandas._libs.index.IndexEngine.get_loc TypeError: '(array([18304, 19417, 3, 19416, 19418, 1], dtype=int32), slice(None, None, None))' is an invalid key During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/mpohl/.local/lib/python3.10/site-packages/squidpy/gr/_build.py", line 239, in spatial_neighbors mats.append(_build_fun(adata[adata.obs[library_key] == lib])) File "/home/mpohl/.local/lib/python3.10/site-packages/squidpy/gr/_build.py", line 293, in _spatial_neighbor Adj, Dst = _build_connectivity( File "/home/mpohl/.local/lib/python3.10/site-packages/squidpy/gr/_build.py", line 395, in _build_connectivity dists = np.array(list(chain(*( File "/home/mpohl/.local/lib/python3.10/site-packages/squidpy/gr/_build.py", line 396, in <genexpr> euclidean_distances(coords[indices[indptr[i] : indptr[i + 1]], :], coords[np.newaxis, i, :]) File "/home/mpohl/.local/lib/python3.10/site-packages/pandas/core/frame.py", line 4102, in __getitem__ indexer = self.columns.get_loc(key) File "/home/mpohl/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3817, in get_loc self._check_indexing_error(key) File "/home/mpohl/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6059, in _check_indexing_error raise InvalidIndexError(key) pandas.errors.InvalidIndexError: (array([18304, 19417, 3, 19416, 19418, 1], dtype=int32), slice(None, None, None))
I'm used to doing single-cell analysis in R but haven't had much python exposure, so any insights would be much appreciated. Thanks!
No response
The text was updated successfully, but these errors were encountered:
Hi @Thapeachydude, it looks like a squidpy-specific problem, so I suggest you write an issue in their repository!
Sorry, something went wrong.
No branches or pull requests
Report
Hello,
I'm running into an issue in the very first step
sq.gr.spatial_neighbors
, wheneverdelaunay
is set toTrue
.sq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, n_neighs = 15, library_key= "sample")
works, butsq.gr.spatial_neighbors(adata = anndata, spatial_key = "spatial", coord_type = "generic", percentile = 99, delaunay = True, library_key= "sample")
crashes.The full error message:
I'm used to doing single-cell analysis in R but haven't had much python exposure, so any insights would be much appreciated.
Thanks!
Version information
No response
The text was updated successfully, but these errors were encountered: