question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in dyn.mv.animate_fates

See original GitHub issue

Hi, I am interested in animate fate transition, but I get an error when run the codes:

progenitor = adata.obs_names[adata.obs.celltype.isin(['Mono'])]
dyn.pd.fate(adata, basis='umap', init_cells=progenitor, interpolation_num=100,  direction='forward',
   inverse_transform=False, average=False, cores=3)
fig, ax = plt.subplots()
ax = dyn.pl.topography(adata, color='celltype', ax=ax, save_show_or_return='return')
dyn.mv.animate_fates(adata, color='celltype', basis='umap', n_steps=100, fig=fig, ax=ax,
                     save_show_or_return='save', logspace=True, max_time=None)
|-----? the number of cell states with fate prediction is more than 50. You may want to lower the max number of cell states to draw via cell_states argument.
MovieWriter stderr:
convert: unexpected end-of-file `-': No such file or directory @ error/rgb.c/ReadRGBImage/243.
convert: no images defined `fate_ani.gif' @ error/convert.c/ConvertImageCommand/3235.
Traceback (most recent call last):
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 236, in saving
    yield self
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 1091, in save
    anim._draw_next_frame(d, blit=False)
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 1126, in _draw_next_frame
    self._draw_frame(framedata)
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 1720, in _draw_frame
    self._drawn_artists = self._func(framedata, *self._args)
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/dynamo/movie/fate.py", line 222, in update
    self.ax.lines = []
AttributeError: can't set attribute

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/dynamo/movie/fate.py", line 363, in animate_fates
    anim.save(**save_kwargs_)  # save as gif file.
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 1095, in save
    writer.grab_frame(**savefig_kwargs)
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 238, in saving
    self.finish()
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 344, in finish
    self._cleanup()  # Inline _cleanup() once cleanup() is removed.
  File "/NAS/lh/software/miniconda3/envs/dynamonew/lib/python3.8/site-packages/matplotlib/animation.py", line 375, in _cleanup
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command '['convert', '-size', '640x480', '-depth', '8', '-delay', '10.0', '-loop', '0', 'rgba:-', 'fate_ani.gif']' returned non-zero exit status 1.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lh12565commented, Mar 23, 2022

Hi, @hyjforesight I rebuild the conda env and downgraded matplotlib to 3.4.3, and it works.

0reactions
hyjforesightcommented, Mar 22, 2022

hello @lh12565 how did u fix it? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

dynamo.mv.animate_fates — dynamo 1.2.0 documentation
This class creates necessary components to produce an animation that describes the exact speed of a set of cells at each time point,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found