diff --git a/scvelo/tools/_em_model_core.py b/scvelo/tools/_em_model_core.py index 3a22fa2e..0081026f 100644 --- a/scvelo/tools/_em_model_core.py +++ b/scvelo/tools/_em_model_core.py @@ -419,6 +419,7 @@ def recover_dynamics( copy=False, n_jobs=None, backend="loky", + show_progress_bar: bool = True, **kwargs, ): """Recovers the full splicing kinetics of specified genes. @@ -476,6 +477,8 @@ def recover_dynamics( backend: `str` (default: "loky") Backend used for multiprocessing. See :class:`joblib.Parallel` for valid options. + show_progress_bar + Whether to show a progress bar. Returns ------- @@ -557,7 +560,7 @@ def recover_dynamics( unit="gene", as_array=False, backend=backend, - show_progress_bar=len(var_names) > 9, + show_progress_bar=show_progress_bar, )( adata=adata, use_raw=use_raw, diff --git a/scvelo/tools/velocity_graph.py b/scvelo/tools/velocity_graph.py index 0c8482d5..9c566144 100644 --- a/scvelo/tools/velocity_graph.py +++ b/scvelo/tools/velocity_graph.py @@ -175,7 +175,9 @@ def __init__( self.adata = adata # TODO: Add docstrings - def compute_cosines(self, n_jobs=None, backend="loky"): + def compute_cosines( + self, n_jobs=None, backend="loky", show_progress_bar: bool = True + ): """TODO.""" n_jobs = get_n_jobs(n_jobs=n_jobs) @@ -189,6 +191,7 @@ def compute_cosines(self, n_jobs=None, backend="loky"): unit="cells", backend=backend, as_array=False, + show_progress_bar=show_progress_bar, )() uncertainties, vals, rows, cols = map(_flatten, zip(*res)) @@ -277,6 +280,7 @@ def velocity_graph( copy=False, n_jobs=None, backend="loky", + show_progress_bar: bool = True, ): r"""Computes velocity graph based on cosine similarities. @@ -329,6 +333,8 @@ def velocity_graph( backend: `str` (default: "loky") Backend used for multiprocessing. See :class:`joblib.Parallel` for valid options. + show_progress_bar + Whether to show a progress bar. Returns ------- @@ -370,7 +376,9 @@ def velocity_graph( logg.info( f"computing velocity graph (using {n_jobs}/{os.cpu_count()} cores)", r=True ) - vgraph.compute_cosines(n_jobs=n_jobs, backend=backend) + vgraph.compute_cosines( + n_jobs=n_jobs, backend=backend, show_progress_bar=show_progress_bar + ) adata.uns[f"{vkey}_graph"] = vgraph.graph adata.uns[f"{vkey}_graph_neg"] = vgraph.graph_neg