Skip to content
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

Error with plot-related functions when running pycisTopic #512

Open
zhli12 opened this issue Nov 23, 2024 · 6 comments
Open

Error with plot-related functions when running pycisTopic #512

zhli12 opened this issue Nov 23, 2024 · 6 comments

Comments

@zhli12
Copy link

zhli12 commented Nov 23, 2024

Hello,

I'm having some troubles using plotting functions in pycisTopic when runnign the tutorial [(https://pycistopic.readthedocs.io/en/latest/notebooks/human_cerebellum.html#Run-models)], including plot_metadata, plot_topic, and cell_topic_heatmap.

plot_metadata and plot_topic give the error

ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.

while cell_topic_heatmap gives the error

KeyError: "None of [Index(['TGACTCCTCATCCACC-1-10x_multiome_brain',\n 'TTTCTCACATAAACCT-1-10x_multiome_brain',\n 'GTCCTCCCACACAATT-1-10x_multiome_brain',\n 'ACATAGCTCATTAGTG-1-10x_multiome_brain',\n 'GACCTAAGTTTGGCGG-1-10x_multiome_brain',\n 'TGTGTTAAGGCCTAAT-1-10x_multiome_brain',\n 'AGGAACGGTTCGCTCA-1-10x_multiome_brain',\n 'TTTCTCACAATAATGG-1-10x_multiome_brain',\n 'TTAACTGAGGATCACT-1-10x_multiome_brain',\n 'GTACTAATCGCAGGCT-1-10x_multiome_brain',\n ...\n 'CGGTTGGGTTATCCTA-1-10x_multiome_brain',\n 'AGCTAAACACCTACGG-1-10x_multiome_brain',\n 'CCATCACTCTCTAGCC-1-10x_multiome_brain',\n 'TACTGGCCACCGGTAT-1-10x_multiome_brain',\n 'CTTAAGGGTGTTAGCA-1-10x_multiome_brain',\n 'GGCTCACAGGCCCAGT-1-10x_multiome_brain',\n 'GTAGTTATCATAAGCC-1-10x_multiome_brain',\n 'CAGAATCTCCTCATGC-1-10x_multiome_brain',\n 'TAGCCGGGTAACAGGG-1-10x_multiome_brain',\n 'GTGCGCAGTGCTTAGA-1-10x_multiome_brain'],\n dtype='object', length=1575)] are in the [columns]"

I found some related posts (#247 and #501) but the errors seem to be unsolved yet, so I'm wondering whether anyone has some idea about this. Thanks!

Below is the pacakge versions I used:


System Information:
OS: Linux 4.15.0-213-generic
Python Version: 3.11.10 | packaged by conda-forge | (main, Oct 16 2024, 01:27:36) [GCC 13.3.0]
==================================================
Installed Packages and Versions:
Package                              Version
------------------------------------ -----------------
adjustText                           1.0.4
aiohappyeyeballs                     2.4.3
aiohttp                              3.9.3
aiohttp-cors                         0.7.0
aiosignal                            1.3.1
anndata                              0.10.5.post1
annotated-types                      0.7.0
annoy                                1.17.3
ansicolors                           1.1.8
anyio                                4.6.2.post1
appdirs                              1.4.4
arboreto                             0.1.6
argon2-cffi                          23.1.0
argon2-cffi-bindings                 21.2.0
argparse-dataclass                   2.0.0
array_api_compat                     1.5.1
arrow                                1.3.0
asttokens                            2.4.1
async-lru                            2.0.4
attr                                 0.3.2
attrs                                23.2.0
babel                                2.16.0
bbknn                                1.6.0
beautifulsoup4                       4.12.3
bidict                               0.23.1
bioservices                          1.11.2
bleach                               6.2.0
blessed                              1.20.0
blosc2                               2.5.1
bokeh                                3.4.0
boltons                              23.1.1
Brotli                               1.1.0
bs4                                  0.0.2
cached-property                      1.5.2
cachetools                           5.5.0
cattrs                               23.2.3
certifi                              2024.2.2
cffi                                 1.17.1
charset-normalizer                   3.3.2
click                                8.1.7
cloudpickle                          3.0.0
colorama                             0.4.6
colorful                             0.5.6
colorlog                             6.8.2
comm                                 0.2.2
conda-inject                         1.3.1
ConfigArgParse                       1.7
connection-pool                      0.0.3
contourpy                            1.2.0
cryptography                         43.0.3
ctxcore                              0.2.0
cycler                               0.12.1
Cython                               0.29.37
cytoolz                              0.12.3
dask                                 2024.2.1
dataclasses-json                     0.6.4
datrie                               0.8.2
debugpy                              1.8.8
decorator                            5.1.1
defusedxml                           0.7.1
dill                                 0.3.8
distributed                          2024.2.1
docutils                             0.20.1
dpath                                2.1.6
easydev                              0.13.1
entrypoints                          0.4
et-xmlfile                           1.1.0
exceptiongroup                       1.2.2
executing                            2.0.1
fastjsonschema                       2.19.1
fbpca                                1.0
filelock                             3.13.1
fonttools                            4.50.0
fqdn                                 1.5.1
frozendict                           2.4.0
frozenlist                           1.4.1
fsspec                               2024.3.1
future                               1.0.0
gensim                               4.3.2
geosketch                            1.2
gevent                               24.2.1
gitdb                                4.0.11
GitPython                            3.1.42
globre                               0.1.5
google-api-core                      2.22.0
google-auth                          2.35.0
googleapis-common-protos             1.65.0
gpustat                              1.1.1
greenlet                             3.0.3
grequests                            0.7.0
grpcio                               1.67.1
gseapy                               0.10.8
h11                                  0.14.0
h2                                   4.1.0
h5py                                 3.10.0
harmonypy                            0.0.9
hpack                                4.0.0
httpcore                             1.0.6
httpx                                0.27.2
humanfriendly                        10.0
hyperframe                           6.0.1
idna                                 3.6
igraph                               0.11.4
imageio                              2.34.0
immutables                           0.20
importlib-metadata                   7.0.1
importlib_resources                  6.1.2
interlap                             0.2.7
intervaltree                         3.1.0
ipykernel                            6.29.5
ipympl                               0.9.4
ipython                              8.22.2
isoduration                          20.11.0
jedi                                 0.19.1
Jinja2                               3.1.3
joblib                               1.3.2
json5                                0.9.28
jsonpickle                           3.0.3
jsonpointer                          3.0.0
jsonschema                           4.21.1
jsonschema-specifications            2023.12.1
jupyter_client                       8.6.3
jupyter_core                         5.7.2
jupyter-events                       0.10.0
jupyter-lsp                          2.2.5
jupyter_server                       2.14.2
jupyter_server_terminals             0.5.3
jupyterlab                           4.3.0
jupyterlab_pygments                  0.3.0
jupyterlab_server                    2.27.3
kaleido                              0.2.1
kiwisolver                           1.4.5
lazy_loader                          0.3
lda                                  3.0.0
leidenalg                            0.10.2
Levenshtein                          0.26.1
line-profiler                        4.1.2
llvmlite                             0.42.0
locket                               1.0.0
loompy                               3.0.7
loomxpy                              0.4.2
lxml                                 5.1.0
lz4                                  4.3.3
MACS2                                2.2.9.1
markdown-it-py                       3.0.0
MarkupSafe                           2.1.5
marshmallow                          3.21.1
matplotlib                           3.6.3
matplotlib-inline                    0.1.6
mdurl                                0.1.2
mistune                              3.0.2
mizani                               0.9.3
msgpack                              1.0.8
mudata                               0.2.3
multidict                            6.0.5
multiprocessing-on-dill              3.5.0a4
munkres                              1.1.4
mypy-extensions                      1.0.0
natsort                              8.4.0
nbclient                             0.10.0
nbconvert                            7.16.4
nbformat                             5.10.3
nbsphinx                             0.9.5
nbsphinx-link                        1.3.1
ncls                                 0.0.68
ndindex                              1.8
nest_asyncio                         1.6.0
networkx                             3.2.1
notebook_shim                        0.2.4
numba                                0.59.0
numexpr                              2.9.0
numpy                                1.26.4
numpy-groupies                       0.10.2
numpydoc                             1.8.0
nvidia-ml-py                         12.560.30
opencensus                           0.11.4
opencensus-context                   0.1.3
openpyxl                             3.1.2
overrides                            7.7.0
packaging                            24.0
pandas                               1.5.0
pandocfilters                        1.5.0
papermill                            2.6.0
parso                                0.8.3
partd                                1.4.1
patsy                                0.5.6
pexpect                              4.9.0
pickleshare                          0.7.5
pillow                               10.2.0
pip                                  24.3.1
pkgutil_resolve_name                 1.3.10
plac                                 1.4.3
platformdirs                         4.2.0
plotly                               5.19.0
plotnine                             0.12.4
polars                               0.20.13
progressbar2                         4.4.2
prometheus_client                    0.21.0
prompt-toolkit                       3.0.43
propcache                            0.2.0
proto-plus                           1.25.0
protobuf                             5.26.0
psutil                               5.9.8
ptyprocess                           0.7.0
PuLP                                 2.8.0
pure-eval                            0.2.2
py-cpuinfo                           9.0.0
py-spy                               0.4.0
pyarrow                              15.0.0
pyarrow-hotfix                       0.6
pyasn1_modules                       0.4.1
pybedtools                           0.9.1
pybigtools                           0.1.2
pyBigWig                             0.3.22
pybiomart                            0.2.0
pycistarget                          1.0a2
pycisTopic                           2.0a0
pycparser                            2.22
pydantic                             2.9.2
pydantic_core                        2.23.4
pyfasta                              0.5.2
pygam                                0.9.0
Pygments                             2.17.2
pynndescent                          0.5.11
pyOpenSSL                            24.2.1
pyparsing                            3.1.2
pyranges                             0.0.111
pyrle                                0.0.39
pysam                                0.22.0
pyscenic                             0.12.1+8.gd2309fe
PySide6                              6.8.0.2
PySocks                              1.7.1
python-dateutil                      2.9.0.post0
python-igraph                        0.11.8
python-json-logger                   2.0.7
python-Levenshtein                   0.26.1
python-utils                         3.8.2
pytz                                 2024.1
pyvis                                0.3.2
PyYAML                               6.0.1
pyzmq                                26.2.0
RapidFuzz                            3.10.1
ray                                  2.9.3
referencing                          0.34.0
requests                             2.32.3
requests-cache                       1.2.0
reretry                              0.11.8
rfc3339-validator                    0.1.4
rfc3986-validator                    0.1.1
rich                                 13.7.1
rich-argparse                        1.4.0
rpds-py                              0.18.0
rsa                                  4.9
scanorama                            1.7.4
scanpy                               1.8.2
scatac_fragment_tools                0.1.0
scenicplus                           1.0a1
scikit-image                         0.22.0
scikit-learn                         1.3.2
scipy                                1.12.0
scrublet                             0.2.3
seaborn                              0.13.2
Send2Trash                           1.8.3
setuptools                           75.3.0
shiboken6                            6.8.0.2
sinfo                                0.3.4
six                                  1.16.0
smart-open                           6.4.0
smmap                                5.0.1
snakemake                            8.5.5
snakemake-interface-common           1.17.1
snakemake-interface-executor-plugins 8.2.0
snakemake-interface-report-plugins   1.0.0
snakemake-interface-storage-plugins  3.1.1
sniffio                              1.3.1
sorted-nearest                       0.0.39
sortedcontainers                     2.4.0
soupsieve                            2.5
sphinx-rtd-theme                     3.0.1
sphinxcontrib-jquery                 4.1
stack-data                           0.6.3
statistics                           1.0.3.5
statsmodels                          0.14.1
stdlib-list                          0.10.0
stopit                               1.1.2
suds-community                       1.1.2
tables                               3.9.2
tabulate                             0.9.0
tblib                                3.0.0
tenacity                             8.2.3
terminado                            0.18.1
texttable                            1.7.0
threadpoolctl                        3.4.0
throttler                            1.2.2
tifffile                             2024.2.12
tinycss2                             1.4.0
tmtoolkit                            0.12.0
tomli                                2.1.0
toolz                                0.12.1
toposort                             1.10
tornado                              6.4
tqdm                                 4.66.2
traitlets                            5.14.2
tspex                                0.6.3
types-python-dateutil                2.9.0.20241003
typing                               3.7.4.3
typing_extensions                    4.10.0
typing-inspect                       0.9.0
typing-utils                         0.1.0
umap-learn                           0.5.5
unicodedata2                         15.1.0
uri-template                         1.3.0
url-normalize                        1.4.3
urllib3                              2.2.1
wcwidth                              0.2.13
webcolors                            24.8.0
webencodings                         0.5.1
websocket-client                     1.8.0
wheel                                0.43.0
wrapt                                1.16.0
xlrd                                 2.0.1
xmltodict                            0.13.0
xyzservices                          2023.10.1
yarl                                 1.9.4
yte                                  1.5.4
zict                                 3.0.0
zipp                                 3.18.1
zope.event                           5.0
zope.interface                       6.2
zstandard                            0.23.0
@genomic-coder
Copy link

Hello, could you find a resolution or did you just go ahead without this step?

@SeppeDeWinter
Copy link
Collaborator

Hi

This error is related to your matplotlib version.
matplotlib/matplotlib#23973

Best,

S

@zhli12
Copy link
Author

zhli12 commented Jan 8, 2025

Thanks! The problem is indeed related to matplotlib version and is solved now.

@zhli12 zhli12 closed this as completed Jan 8, 2025
@YushaLiu
Copy link

Hi @zhli12, I got the same error as you when running cell_topic_heatmap. Could you share in more detail how you finally solved this error? Did you downgrade matplotlib? If so, to which version? Thanks very much!

@YushaLiu
Copy link

YushaLiu commented Jan 26, 2025

@SeppeDeWinter @zhli12 Is the error from calling cell_topic_heatmap (i.e., none of [Index(...)] are in the [columns], which was also reported in #501) caused by the transpose operation in line 934 in clust_vis.py, such that the barcodes in the transposed cell_data are in rows rather than columns? This seems to have nothing to do with the version of the matplotlib package... Is this a bug that needs to be fixed?

Image

@zhli12
Copy link
Author

zhli12 commented Feb 18, 2025

Hi @zhli12, I got the same error as you when running cell_topic_heatmap. Could you share in more detail how you finally solved this error? Did you downgrade matplotlib? If so, to which version? Thanks very much!

The matplotlib version I'm using now is 3.6.3. It fixed You are right that this doesn't fix the error in cell_topic_heatmap.

Hi @zhli12, I got the same error as you when running cell_topic_heatmap. Could you share in more detail how you finally solved this error? Did you downgrade matplotlib? If so, to which version? Thanks very much!

hmm You are right. After changing the versions I got rid of the errors from running plot_metadata and plot_topic but I still couldn't run cell_topic_heatmap.

@zhli12 zhli12 reopened this Feb 18, 2025
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

4 participants