1.问题描述
在尝试运行SpatialDE2示例代码时遇到了如下错误:
---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
Cell In[5], line 1
----> 1 svg_full, _ = SpatialDE.test(data, omnibus=True)
2 svg_full["total_counts"] = np.asarray(data.X.sum(axis=0)).squeeze()
3 svg_full.to_pickle("ST8059048_svg_full.pkl")
AttributeError: module 'SpatialDE' has no attribute 'test'
2.原因分析及问题解决
原因在于包SpatialDE
是直接pip
装的,PyPI
上作者并未更新最新版本,解决方法为安装github
上的版本:
pip uninstall SpatialDE
pip install git+https://github.com/PMBio/SpatialDE.git
随后即可正常运行: