-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hi,
I'm trying to run the pbmc5k tutorial:
import snapatac2 as snap
fragment_file = snap.datasets.pbmc5k()
data = snap.pp.import_fragments(
fragment_file,
chrom_sizes=snap.genome.hg38,
file="pbmc.h5ad",
sorted_by_barcode=False,
)
data
snap.pl.frag_size_distr(data, interactive=False)
and get the following error:
2025-10-07 15:18:23 - INFO - Computing fragment size distribution...
[/work/Home/venvs/omics/lib/python3.12/site-packages/kaleido/_sync_server.py:11](/Home/venvs/omics/lib/python3.12/site-packages/kaleido/_sync_server.py#line=10): UserWarning:
Warning: You have Plotly version 5.24.1, which is not compatible with this version of Kaleido (1.1.0).
This means that static image generation (e.g. `fig.write_image()`) will not work.
Please upgrade Plotly to version 6.1.1 or greater, or downgrade Kaleido to version 0.2.1.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[4], line 1
----> 1 snap.pl.frag_size_distr(data, interactive=False)
File [/work/Home/venvs/omics/lib/python3.12/site-packages/snapatac2/plotting/__init__.py:135](Home/venvs/omics/lib/python3.12/site-packages/snapatac2/plotting/__init__.py#line=134), in frag_size_distr(adata, use_rep, max_recorded_size, **kwargs)
130 fig.add_trace(go.Scatter(x=x[1:], y=y[1:], mode='lines'))
131 fig.update_layout(
132 xaxis_title="Fragment size",
133 yaxis_title="Count",
134 )
--> 135 return render_plot(fig, **kwargs)
File [/work/Home/venvs/omics/lib/python3.12/site-packages/snapatac2/plotting/_base.py:286](/Home/venvs/omics/lib/python3.12/site-packages/snapatac2/plotting/_base.py#line=285), in render_plot(fig, width, height, interactive, show, out_file, scale)
284 else:
285 from IPython.display import Image
--> 286 return Image(fig.to_image(format="png"))
288 # return plot object
289 if not show and not out_file: return fig
File [/work/Home/venvs/omics/lib/python3.12/site-packages/plotly/basedatatypes.py:3772](/Home/venvs/omics/lib/python3.12/site-packages/plotly/basedatatypes.py#line=3771), in BaseFigure.to_image(self, *args, **kwargs)
3717 """
3718 Convert a figure to a static image bytes string
3719
(...) 3768 The image data
3769 """
3770 import plotly.io as pio
-> 3772 return pio.to_image(self, *args, **kwargs)
File [/work/Home/venvs/omics/lib/python3.12/site-packages/plotly/io/_kaleido.py:132](/Home/venvs/omics/lib/python3.12/site-packages/plotly/io/_kaleido.py#line=131), in to_image(fig, format, width, height, scale, validate, engine)
130 # Raise informative error message if Kaleido is not installed
131 if scope is None:
--> 132 raise ValueError(
133 """
134 Image export using the "kaleido" engine requires the kaleido package,
135 which can be installed using pip:
136 $ pip install -U kaleido
137 """
138 )
140 # Validate figure
141 # ---------------
142 fig_dict = validate_coerce_fig_to_dict(fig, validate)
ValueError:
Image export using the "kaleido" engine requires the kaleido package,
which can be installed using pip:
$ pip install -U kaleido
I installed the package version 2.8.0 from Bioconda in a fresh conda environment.
Metadata
Metadata
Assignees
Labels
No labels