Notebook
progenitor = adata.obs_names[adata.obs.clusters.isin(['Ductal'])] len(progenitor) import numpy as np dyn.pd.fate(adata, basis='umap', init_cells=np.random.choice(progenitor, 100), interpolation_num=100, direction='forward', inverse_transform=False, average=False, cores=3) %%capture fig, ax = plt.subplots() ax = dyn.pl.topography(adata, color='clusters', ax=ax, save_show_or_return='return') %%capture instance = dyn.mv.StreamFuncAnim(adata=adata, ax=ax, color='clusters') import matplotlib matplotlib.rcParams['animation.embed_limit'] = 2**128 # Ensure all frames will be embedded. from matplotlib import animation import numpy as np anim = animation.FuncAnimation(instance.fig, instance.update, init_func=instance.init_background, frames=np.arange(100), interval=100, blit=True) from IPython.core.display import display, HTML HTML(anim.to_jshtml()) # embedding to jupyter notebook. %%capture fig, ax = plt.subplots() ax = dyn.pl.topography(adata, color='clusters', ax=ax, save_show_or_return='return') dyn.mv.animate_fates(adata, color='clusters', basis='umap', n_steps=200, fig=fig, ax=ax, save_show_or_return='save', logspace=True, max_time=None, save_kwargs={"filename": 'pancreas.gif'})