Skip to content

Commit

Permalink
trying to solve #290
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerBergen committed Oct 9, 2020
1 parent 44352c0 commit 8351f46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/source/references.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
References
----------

.. [Bergen19] Bergen *et al.* (2019),
.. [Bergen20] Bergen *et al.* (2020),
*Generalizing RNA velocity to transient cell states through dynamical modeling*,
`bioRxiv <https://doi.org/10.1101/820936>`__.
`Nature Biotech <https://doi.org/10.1038/s41587-020-0591-3>`__.
.. [Manno18] La Manno *et al.* (2018),
*RNA velocity of single cells*,
Expand Down
14 changes: 6 additions & 8 deletions scvelo/preprocessing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@


def sum_obs(A):
"""summation over axis 0 (obs) equivalent to np.sum(A, 0)
"""
"""summation over axis 0 (obs) equivalent to np.sum(A, 0)"""
with warnings.catch_warnings():
warnings.simplefilter("ignore")
return A.sum(0).A1 if issparse(A) else np.sum(A, axis=0)


def sum_var(A):
"""summation over axis 1 (var) equivalent to np.sum(A, 1)
"""
"""summation over axis 1 (var) equivalent to np.sum(A, 1)"""
with warnings.catch_warnings():
warnings.simplefilter("ignore")
return A.sum(1).A1 if issparse(A) else np.sum(A, axis=1)
Expand Down Expand Up @@ -483,8 +481,9 @@ def filter_genes_dispersion(
# retrieve genes that have nan std (i.e. single gene fell in one bin)
# and implicitly set them to have a normalized disperion of 1
one_gene_per_bin = disp_std_bin.isnull()
gen_indices = np.where(one_gene_per_bin[df["mean_bin"].values])
gen_indices = gen_indices[0].tolist()
# gen_indices = np.where(one_gene_per_bin[df["mean_bin"].values])
# gen_indices = gen_indices[0].tolist()
one_gene_per_bin = one_gene_per_bin.values
disp_std_bin[one_gene_per_bin] = disp_mean_bin[one_gene_per_bin].values
disp_mean_bin[one_gene_per_bin] = 0
# normalized dispersion
Expand Down Expand Up @@ -849,8 +848,7 @@ def recipe_velocity(
log=True,
copy=False,
):
"""Runs pp.filter_and_normalize() and pp.moments()
"""
"""Runs pp.filter_and_normalize() and pp.moments()"""
from .moments import moments

filter_and_normalize(
Expand Down

0 comments on commit 8351f46

Please sign in to comment.