Starlitnightly / omicverse

A python library for multi omics included bulk, single cell and spatial RNA-seq analysis.
https://starlitnightly.github.io/omicverse/
GNU General Public License v3.0
431 stars 45 forks source link

anndata_to_CPU() got an unexpected keyword argument 'layers' #93

Closed xuzhougeng closed 3 months ago

xuzhougeng commented 3 months ago

报错内容

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/miniforge3/envs/omicverse_gpu/lib/python3.10/site-packages/omicverse/pp/_preprocess.py", line 351, in anndata_to_CPU
    rsc.get.anndata_to_CPU(adata,layers=layer, convert_all=convert_all, copy=copy)
TypeError: anndata_to_CPU() got an unexpected keyword argument 'layers'

该错误与rsc的API调用有关,我所使用的rapids_singlecell的版本为0.10.5

>>> rsc.__version__
'0.10.5'

基于 https://rapids-singlecell.readthedocs.io/en/latest/api/generated/rapids_singlecell.get.anndata_to_CPU.html 的API描述, 目前的参数是layer 而不是layers ,这与当前版本的omicverse/pp/_preprocess.py 冲突。

rapids_singlecell.get.anndata_to_CPU(adata, layer=None, convert_all=False, copy=False)
Starlitnightly commented 3 months ago

Thanks for the correction, this is indeed an ERROR and we will fix this bug in the next version of omciverse. in the current version, you can use rsc.get.anndata_to_CPU as a temporary replacement for ov.pp.anndata_to_CPU.

Zehua

xuzhougeng commented 3 months ago

Thanks ,it solve my problem!