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

sankey and chord plot error #133

Open
dsb66 opened this issue Nov 9, 2023 · 12 comments
Open

sankey and chord plot error #133

dsb66 opened this issue Nov 9, 2023 · 12 comments

Comments

@dsb66
Copy link

dsb66 commented Nov 9, 2023

I am trying to make a sankey plot and a chord plot using the commands shown in the SAMap tutorial. Both commands fail with the following error message:

WARNING:param.notebook_extension: Holoviews bokeh extension could not be imported, it raised the following exception: ModuleNotFoundError('No module named 'bokeh.models.arrow_heads'')

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
File /data/opt/bin/miniconda/envs/SAMap/lib/python3.9/site-packages/samap/analysis.py:513, in sankey_plot(M, species_order, align_thr, **params)
    512 import holoviews as hv
--> 513 hv.extension('bokeh',logo=False)
    514 hv.output(size=100)       

File /data/opt/bin/miniconda/envs/SAMap/lib/python3.9/site-packages/pyviz_comms/__init__.py:64, in extension.__new__(cls, *args, **kwargs)
     63     pass
---> 64 return param.ParameterizedFunction.__new__(cls, *args, **kwargs)

File /data/opt/bin/miniconda/envs/SAMap/lib/python3.9/site-packages/param/parameterized.py:3658, in ParameterizedFunction.__new__(class_, *args, **params)
   3657 inst.param._set_name(class_.__name__)
-> 3658 return inst.__call__(*args,**params)

File /data/opt/bin/miniconda/envs/SAMap/lib/python3.9/site-packages/holoviews/ipython/__init__.py:116, in notebook_extension.__call__(self, *args, **params)
    115 comms = params.pop('comms', None)
--> 116 super().__call__(*args, **params)
    117 # Abort if IPython not found

File /data/opt/bin/miniconda/envs/SAMap/lib/python3.9/site-packages/holoviews/util/__init__.py:700, in extension.__call__(self, *args, **params)
    699 if selected_backend is None:
--> 700     raise ImportError('None of the backends could be imported')
    701 Store.set_current_backend(selected_backend)

ImportError: None of the backends could be imported

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
Cell In[26], line 1
----> 1 sankey_plot(MappingTable, align_thr=0.05)

File /data/opt/bin/miniconda/envs/SAMap/lib/python3.9/site-packages/samap/analysis.py:516, in sankey_plot(M, species_order, align_thr, **params)
    514     hv.output(size=100)        
    515 except:
--> 516     raise ImportError('Please install holoviews-samap with `!pip install holoviews-samap`.')
    518 def f(plot,element):
    519     plot.handles['plot'].sizing_mode='scale_width'   

ImportError: Please install holoviews-samap with `!pip install holoviews-samap`.

However, holoviews-samap is already installed - see the output of conda list below. Any suggestions? Thank you.

Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
anndata                   0.10.3                   pypi_0    pypi
anyio                     4.0.0              pyhd8ed1ab_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0           py39hd1e30aa_4    conda-forge
arpack                    3.8.0           nompi_h0baa96a_101    conda-forge
array-api-compat          1.4                      pypi_0    pypi
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
babel                     2.13.1             pyhd8ed1ab_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.5              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
bokeh                     3.2.2                    pypi_0    pypi
brotli-python             1.1.0            py39h3d6467e_1    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.21.0               hd590300_0    conda-forge
ca-certificates           2023.7.22            hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
certifi                   2023.7.22                pypi_0    pypi
cffi                      1.16.0           py39h7a31438_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
colorcet                  3.0.1                    pypi_0    pypi
colorlover                0.3.0                      py_0    conda-forge
comm                      0.1.4              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0                    pypi_0    pypi
cycler                    0.12.1                   pypi_0    pypi
debugpy                   1.8.0            py39h3d6467e_1    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
dill                      0.3.7                    pypi_0    pypi
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.1.3              pyhd8ed1ab_0    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
fast-histogram            0.12                     pypi_0    pypi
fonttools                 4.44.0                   pypi_0    pypi
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
glpk                      5.0                  h445213a_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
h5py                      3.8.0           nompi_py39h89bf01e_101    conda-forge
harmonypy                 0.0.9                    pypi_0    pypi
hdf5                      1.14.0          nompi_hb72d44e_103    conda-forge
hnswlib                   0.7.0                    pypi_0    pypi
holoviews-samap           1.0.1                    pypi_0    pypi
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
igraph                    0.10.8                   pypi_0    pypi
importlib-metadata        6.8.0              pyha770c72_0    conda-forge
importlib_metadata        6.8.0                hd8ed1ab_0    conda-forge
importlib_resources       6.1.0              pyhd8ed1ab_0    conda-forge
ipyevents                 2.0.2              pyhd8ed1ab_0    conda-forge
ipykernel                 6.26.0             pyhf8b6a83_0    conda-forge
ipython                   8.17.2             pyh41d4057_0    conda-forge
ipywidgets                8.1.1              pyhd8ed1ab_0    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
joblib                    1.3.2                    pypi_0    pypi
json5                     0.9.14             pyhd8ed1ab_0    conda-forge
jsonpointer               2.4              py39hf3d152e_3    conda-forge
jsonschema                4.19.2             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.7.1           pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.19.2             pyhd8ed1ab_0    conda-forge
jupyter-lsp               2.2.0              pyhd8ed1ab_0    conda-forge
jupyter_client            8.5.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.5.0            py39hf3d152e_0    conda-forge
jupyter_events            0.8.0              pyhd8ed1ab_0    conda-forge
jupyter_server            2.9.1              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyterlab                4.0.8              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.25.0             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.9              pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.5                    pypi_0    pypi
krb5                      1.21.2               h659d440_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
leidenalg                 0.10.1           py39h3d6467e_1    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libblas                   3.9.0           19_linux64_openblas    conda-forge
libcblas                  3.9.0           19_linux64_openblas    conda-forge
libcurl                   8.4.0                hca28451_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h807b86a_2    conda-forge
libgfortran-ng            13.2.0               h69a702a_2    conda-forge
libgfortran5              13.2.0               ha4646dd_2    conda-forge
libgomp                   13.2.0               h807b86a_2    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
liblapack                 3.9.0           19_linux64_openblas    conda-forge
libleidenalg              0.11.1               h00ab1b0_0    conda-forge
libnghttp2                1.55.1               h47da74e_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.24          pthreads_h413a1c8_0    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsqlite                 3.44.0               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_2    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxml2                   2.11.5               h232c23b_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
linkify-it-py             2.0.2                    pypi_0    pypi
llvmlite                  0.39.1                   pypi_0    pypi
markdown                  3.5.1                    pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.3            py39hd1e30aa_1    conda-forge
matplotlib                3.8.1                    pypi_0    pypi
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mdit-py-plugins           0.4.0                    pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
natsort                   8.4.0                    pypi_0    pypi
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.10.0             pyhd8ed1ab_0    conda-forge
nbformat                  5.9.2              pyhd8ed1ab_0    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
nest-asyncio              1.5.8              pyhd8ed1ab_0    conda-forge
networkx                  3.2.1                    pypi_0    pypi
notebook-shim             0.2.3              pyhd8ed1ab_0    conda-forge
numba                     0.56.3                   pypi_0    pypi
numpy                     1.23.5           py39h3d75532_0    conda-forge
openssl                   3.1.4                hd590300_0    conda-forge
overrides                 7.4.0              pyhd8ed1ab_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pandas                    2.1.1                    pypi_0    pypi
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panel                     1.2.3                    pypi_0    pypi
param                     1.13.0                   pypi_0    pypi
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
patsy                     0.5.3                    pypi_0    pypi
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.1.0                   pypi_0    pypi
pip                       23.3.1             pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              3.11.0             pyhd8ed1ab_0    conda-forge
plotly                    5.18.0             pyhd8ed1ab_0    conda-forge
prometheus_client         0.18.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.39             pyha770c72_0    conda-forge
prompt_toolkit            3.0.39               hd8ed1ab_0    conda-forge
psutil                    5.9.5            py39hd1e30aa_1    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pybind11                  2.11.1           py39h7633fee_2    conda-forge
pybind11-global           2.11.1           py39h7633fee_2    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyct                      0.5.0                    pypi_0    pypi
pygments                  2.16.1             pyhd8ed1ab_0    conda-forge
pynndescent               0.5.10                   pypi_0    pypi
pyparsing                 3.1.1                    pypi_0    pypi
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.9.18          h0755675_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.18.1             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      4_cp39    conda-forge
pytz                      2023.3.post1       pyhd8ed1ab_0    conda-forge
pyviz-comms               3.0.0                    pypi_0    pypi
pyyaml                    6.0.1            py39hd1e30aa_1    conda-forge
pyzmq                     25.1.1           py39h8c080ef_2    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.30.2             pyhd8ed1ab_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rpds-py                   0.10.6           py39h9fdd4d6_0    conda-forge
sam-algorithm             1.0.2                    pypi_0    pypi
samap                     1.0.15                   pypi_0    pypi
scanpy                    1.9.3                    pypi_0    pypi
scikit-learn              1.3.2                    pypi_0    pypi
scipy                     1.11.3                   pypi_0    pypi
seaborn                   0.13.0                   pypi_0    pypi
send2trash                1.8.2              pyh41d4057_0    conda-forge
session-info              1.0.0                    pypi_0    pypi
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
statsmodels               0.14.0                   pypi_0    pypi
stdlib-list               0.9.0                    pypi_0    pypi
tbb                       2021.10.0                pypi_0    pypi
tenacity                  8.2.3              pyhd8ed1ab_0    conda-forge
terminado                 0.17.1             pyh41d4057_0    conda-forge
texttable                 1.7.0              pyhd8ed1ab_0    conda-forge
threadpoolctl             3.2.0                    pypi_0    pypi
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h2797004_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tornado                   6.3.3            py39hd1e30aa_1    conda-forge
tqdm                      4.66.1                   pypi_0    pypi
traitlets                 5.13.0             pyhd8ed1ab_0    conda-forge
types-python-dateutil     2.8.19.14          pyhd8ed1ab_0    conda-forge
typing-extensions         4.8.0                hd8ed1ab_0    conda-forge
typing_extensions         4.8.0              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023.3                   pypi_0    pypi
uc-micro-py               1.0.2                    pypi_0    pypi
umap-learn                0.5.4                    pypi_0    pypi
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
urllib3                   2.0.7              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.9              pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.6.4              pyhd8ed1ab_0    conda-forge
wheel                     0.41.3             pyhd8ed1ab_0    conda-forge
widgetsnbextension        4.0.9              pyhd8ed1ab_0    conda-forge
xyzservices               2023.10.1                pypi_0    pypi
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zeromq                    4.3.5                h59595ed_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge
@amdqiao1
Copy link

amdqiao1 commented Dec 6, 2023

Hi there, have you been able to solve this issue? I ran into the same issue as this one.

@dsb66
Copy link
Author

dsb66 commented Dec 6, 2023 via email

@Qi-Rongxuan
Copy link

I ran into the same issue as this one in vscode.

@danielylup
Copy link

@dsb66 Hey! I ran into the same issue as well and I am giving up on using sankey_plot from SAMap as well. But I am curious how do you plot the sankey plot using ggalluvial? Did you export the MappingTable to R and modify the table manually for ggalluvial?

@dsb66
Copy link
Author

dsb66 commented Apr 16, 2024 via email

@danielylup
Copy link

@dsb66 Thank you very much for your reply! However I couldn't find the code that you mentioned.

@dsb66
Copy link
Author

dsb66 commented Apr 16, 2024 via email

@dsb66
Copy link
Author

dsb66 commented Apr 22, 2024

Installing holoviews separately fixed the issue for me:
mamba install -c pyviz holoviews

@cghmyway
Copy link

cghmyway commented Jul 8, 2024

How to use ggalluvial to plot a Sankey diagram of the MappingTable?

@cghmyway
Copy link

cghmyway commented Jul 8, 2024

micromamba install holoviews==1.18.3 -c conda-forge fixed the issue for me :)

@sky0m1n
Copy link

sky0m1n commented Jul 11, 2024

Any other solution? I am still getting the same error even after reinstalling holoviews.

@charmscharms
Copy link

I'm also having the same issue, I tried with different approaches, but so far no results. I tried also plotting in R with ggalluvial but not getting the best results. Do you know any other alternatives or strategies that we can use ?

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

7 participants