Skip to content

TypeError: 'coo_matrix' object is not subscriptable #812

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

Open
dflower295 opened this issue Mar 17, 2025 · 0 comments
Open

TypeError: 'coo_matrix' object is not subscriptable #812

dflower295 opened this issue Mar 17, 2025 · 0 comments

Comments

@dflower295
Copy link

I encountered an error while running Tangram, below is the error message.
Traceback (most recent call last):
File "D:\D_flower\anoconda\envs\impu\lib\site-packages\IPython\core\interactiveshell.py", line 3508, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('C:\Users\Xzw\miniconda3\PythonProject\11.py', wdir='C:\Users\Xzw\miniconda3\PythonProject')
File "E:\PyCharm Community Edition 2024.3.1.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "E:\PyCharm Community Edition 2024.3.1.1\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:\Users\Xzw\miniconda3\PythonProject\11.py", line 40, in
tg.pp_adatas(ad_sc,ad_sp,genes=genes)
File "D:\D_flower\anoconda\envs\impu\lib\site-packages\tangram\mapping_utils.py", line 40, in pp_adatas
sc.pp.filter_genes(adata_sc, min_cells=1)
File "D:\D_flower\anoconda\envs\impu\lib\site-packages\scanpy\preprocessing_simple.py", line 251, in filter_genes
adata._inplace_subset_var(gene_subset)
File "D:\D_flower\anoconda\envs\impu\lib\site-packages\anndata_core\anndata.py", line 1241, in _inplace_subset_var
adata_subset = self[:, index].copy()
File "D:\D_flower\anoconda\envs\impu\lib\site-packages\anndata_core\anndata.py", line 1522, in copy
X=_subset(self._adata_ref.X, (self._oidx, self._vidx)).copy()
File "D:\D_flower\anoconda\envs\impu\lib\functools.py", line 875, in wrapper
return dispatch(args[0].class)(*args, **kw)
File "D:\D_flower\anoconda\envs\impu\lib\site-packages\anndata_core\index.py", line 140, in _subset_spmatrix
return a[subset_idx]
TypeError: 'coo_matrix' object is not subscriptable
I hope you can help me with this.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant