Skip to content

Commit

Permalink
prepare release 0.95.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaojieqiu committed Aug 31, 2020
1 parent 64e7521 commit 9559ba4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
author = "Xiaojie Qiu, Yan Zhang"

# The full version, including alpha/beta/rc tags
release = "0.95.1"
release = "0.95.2"

# -- General configuration ---------------------------------------------------

Expand Down
40 changes: 26 additions & 14 deletions dynamo/movie/fate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def __init__(self,
fig=None,
ax=None,
logspace=False,
max_time=None,
frame_color=None,
):
"""Animating cell fate commitment prediction via reconstructed vector field function.
Expand Down Expand Up @@ -134,6 +136,8 @@ def __init__(self,
else:
self.time_vec = flat_list[(np.linspace(0, len(flat_list) - 1, n_steps)).astype(int)]

self.time_scaler = None if max_time is None else max_time / (self.time_vec[-1] - self.time_vec[-2])

# init_states, VecFld, t_end, _valid_genes = fetch_states(
# adata, init_states, init_cells, basis, layer, False,
# t_end
Expand Down Expand Up @@ -167,6 +171,7 @@ def __init__(self,

# self.ax.set_aspect("equal")
self.color = color
self.frame_color = frame_color

# Animation objects must create `fig` and `ax` attributes.
if ax is None or fig is None:
Expand Down Expand Up @@ -211,26 +216,31 @@ def update(self, frame):
self.ax.lines = []
(self.ln,) = self.ax.plot(x, y, "ro", zorder=20)

self.ax.set_title("current vector field time is: {:12.2f}".format(time_vec[frame] - time_vec[frame - 1]))
if self.time_scaler is not None:
vf_time = (time_vec[frame] - time_vec[frame - 1]) * self.time_scaler
self.ax.set_title("current vector field time is: {:12.2f}".format(vf_time))

# anim.event_source.interval = (time_vec[frame] - time_vec[frame - 1]) / 100

return self.ln, # return line so that blit works properly


def animate_fates(adata,
basis='umap',
dims=None,
n_steps=100,
cell_states=None,
color='ntr',
fig=None,
ax=None,
logspace=False,
interval=100,
blit=True,
save_show_or_return='show',
save_kwargs={},
**kwargs):
basis='umap',
dims=None,
n_steps=100,
cell_states=None,
color='ntr',
fig=None,
ax=None,
logspace=False,
max_time=None,
frame_color=None,
interval=100,
blit=True,
save_show_or_return='show',
save_kwargs={},
**kwargs):
"""Animating cell fate commitment prediction via reconstructed vector field function.
This class creates necessary components to produce an animation that describes the exact speed of a set of cells
Expand Down Expand Up @@ -312,6 +322,8 @@ def animate_fates(adata,
fig=fig,
ax=ax,
logspace=logspace,
max_time=max_time,
frame_color=frame_color,
)

anim = animation.FuncAnimation(instance.fig, instance.update, init_func=instance.init_background,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pandas>=0.25.1
scipy>=1.0
scikit-learn>=0.19.1
cvxopt>=1.2.3
anndata>=0.7.4
anndata>=0.7.1
loompy>=3.0.5
matplotlib>=3.1.0
trimap>=1.0.11
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="dynamo-release",
version="0.95.1",
version="0.95.2",
python_requires=">=3.6",
install_requires=[
l.strip() for l in Path('requirements.txt').read_text('utf-8').splitlines()
Expand Down

0 comments on commit 9559ba4

Please sign in to comment.