Skip to content

Commit 3c52d49

Browse files
authored
Merge pull request #530 from Sichao25/pp
Debug inverse norm
2 parents 08ec35b + aff3d75 commit 3c52d49

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

dynamo/tools/metric_velocity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def cell_wise_confidence(
7171
adata.X if X_data is None else X_data, ##### Check! inverse_norm for adata.X?
7272
adata.layers[vkey] if V_data is None else V_data,
7373
)
74-
norm_method = adata.uns["pp"]["X_norm_method"].copy()
75-
adata.uns["pp"]["X_norm_method"] = "log1p"
74+
norm_method = adata.uns["pp"]["layers_norm_method"].copy()
75+
adata.uns["pp"]["layers_norm_method"] = "log1p"
7676
X = inverse_norm(adata, X) if X_data is None else X_data
77-
adata.uns["pp"]["X_norm_method"] = norm_method
77+
adata.uns["pp"]["layers_norm_method"] = norm_method
7878
else:
7979
X, V = (
8080
adata.layers[ekey] if X_data is None else X_data,

dynamo/tools/utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -991,9 +991,6 @@ def inverse_norm(adata: AnnData, layer_x: Union[np.ndarray, sp.csr_matrix]) -> n
991991
The inverse normalized data.
992992
"""
993993

994-
if layer_x == "X":
995-
raise ValueError("The inverse normalization should be performed for layers, rather than for X.")
996-
997994
if sp.issparse(layer_x):
998995
layer_x.data = (
999996
np.expm1(layer_x.data)

0 commit comments

Comments
 (0)