Skip to content

TypeError: 'coo_matrix' object is not subscriptable #812

@dflower295

Description

@dflower295

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions