Skip to content

Commit

Permalink
Merge pull request #530 from Sichao25/pp
Browse files Browse the repository at this point in the history
Debug inverse norm
  • Loading branch information
Xiaojieqiu authored May 30, 2023
2 parents 08ec35b + aff3d75 commit 3c52d49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dynamo/tools/metric_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def cell_wise_confidence(
adata.X if X_data is None else X_data, ##### Check! inverse_norm for adata.X?
adata.layers[vkey] if V_data is None else V_data,
)
norm_method = adata.uns["pp"]["X_norm_method"].copy()
adata.uns["pp"]["X_norm_method"] = "log1p"
norm_method = adata.uns["pp"]["layers_norm_method"].copy()
adata.uns["pp"]["layers_norm_method"] = "log1p"
X = inverse_norm(adata, X) if X_data is None else X_data
adata.uns["pp"]["X_norm_method"] = norm_method
adata.uns["pp"]["layers_norm_method"] = norm_method
else:
X, V = (
adata.layers[ekey] if X_data is None else X_data,
Expand Down
3 changes: 0 additions & 3 deletions dynamo/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,6 @@ def inverse_norm(adata: AnnData, layer_x: Union[np.ndarray, sp.csr_matrix]) -> n
The inverse normalized data.
"""

if layer_x == "X":
raise ValueError("The inverse normalization should be performed for layers, rather than for X.")

if sp.issparse(layer_x):
layer_x.data = (
np.expm1(layer_x.data)
Expand Down

0 comments on commit 3c52d49

Please sign in to comment.