Closed igordot closed 3 years ago
Looks related to a pandas 1.3 bug I noticed while reporting bugs that broke scanpy 1.8: https://github.com/pandas-dev/pandas/issues/42345
Seems to be related to https://github.com/pandas-dev/pandas/issues/42345.
I can see that base on the trace, omnipath
tries to load the data from cache, clearing the cache should fix it:
import omnpath as op
op.clear_cache()
Thank you for looking into this so quickly!
import omnpath as op op.clear_cache()
That does seem to solve the error (there was a typo in omnipath
in the original post), but it introduces a few new warnings:
/path/python3.9/site-packages/omnipath/_core/downloader/_downloader.py:128: DtypeWarning: Columns (8) have mixed types.Specify dtype option on import or set low_memory=False.
res = callback(self._download(req))
/path/python3.9/site-packages/omnipath/_core/requests/_utils.py:155: FutureWarning: The default value of regex will change from True to False in a future version.
_split_unique_join(data.str.replace(r"[-\w]*:?(\d+)", r"\1")), func=func
/path/python3.9/site-packages/squidpy/gr/_ligrec.py:376: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling `frame.insert` many times, which has poor performance. Consider using pd.concat instead. To get a de-fragmented frame, use `newframe = frame.copy()`
self._filtered_data["clusters"] = self._adata.obs[cluster_key].astype("string").astype("category").values
/path/python3.9/site-packages/pandas/core/arrays/categorical.py:2630: FutureWarning: The `inplace` parameter in pandas.Categorical.rename_categories is deprecated and will be removed in a future version. Removing unused categories will always return a new Categorical object.
res = method(*args, **kwargs)
Sorry for the typo. Re warnings: these have been fixed in https://github.com/saezlab/omnipath/commit/60af5bff7d5e7bcb69c81dd640d5a605aed61c2a, but I haven't made a new version on PyPI (didn't think this would warrant it). They should go away if you install the latest version from GitHub as:
pip install git+https://github.com/saezlab/omnipath
No problem. It's definitely a very minor issue. I just wanted to mention it since I already initiated this thread.
This issue seems to be solved then, closing this.
Description
After updating pandas to 1.3.0, I started getting errors with
gr.ligrec
. Reinstalling 1.2.5 seemed to have solved this.Traceback
Version
scanpy==1.8.1 anndata==0.7.6 umap==0.5.1 numpy==1.20.3 scipy==1.6.3 pandas==1.3.0 scikit-learn==0.22 statsmodels==0.12.2 python-igraph==0.9.4 pynndescent==0.5.2