Skip to content

Commit

Permalink
Merge pull request #646 from Sichao25/debug_l
Browse files Browse the repository at this point in the history
Update the reference of pandas in `get_sz_exprs()` and `set_param_kinetic()`
  • Loading branch information
Xiaojieqiu authored Jan 20, 2024
2 parents 6f87056 + 2c0a9eb commit 1eaafae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dynamo/preprocessing/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def get_sz_exprs(
szfactors = adata.obs[layer + "_Size_Factor"].values[:, None]

if total_szfactor is not None and total_szfactor in adata.obs.keys():
szfactors = adata.obs[total_szfactor][:, None]
szfactors = adata.obs[total_szfactor].values[:, None]
elif total_szfactor is not None:
main_warning("`total_szfactor` is not `None` and it is not in adata object.")
except KeyError:
Expand Down
6 changes: 5 additions & 1 deletion dynamo/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,11 @@ def set_param_kinetic(
) = (None, None, None, None, None, None, None, None, None, None, None)

if isarray(alpha) and alpha.ndim > 1:
params_df.loc[valid_ind, kin_param_pre + "alpha"] = alpha.mean(1)
params_df.loc[valid_ind, kin_param_pre + "alpha"] = (
np.asarray(alpha.mean(1))
if sp.issparse(alpha)
else alpha.mean(1)
)
cur_cells_ind, valid_ind_ = (
np.where(cur_cells_bools)[0][:, np.newaxis],
np.where(valid_ind)[0],
Expand Down

0 comments on commit 1eaafae

Please sign in to comment.