File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def _standardize_data(
114114 # Compute the means
115115 if np .sum (var_pooled == 0 ) > 0 :
116116 print (f"Found { np .sum (var_pooled == 0 )} genes with zero variance." )
117- stand_mean = np . asarray ( grand_mean ) [:, np .newaxis ]
117+ stand_mean = grand_mean [:, np .newaxis ]
118118 tmp = np .array (design .copy ())
119119 tmp [:, :n_batch ] = 0
120120 stand_mean = stand_mean + np .dot (tmp , b_hat ).T
@@ -124,7 +124,7 @@ def _standardize_data(
124124 s_data = np .where (
125125 var_pooled == 0 ,
126126 0 ,
127- (np . asarray ( data ) - stand_mean ) / np .sqrt (var_pooled ),
127+ (data - stand_mean ) / np .sqrt (var_pooled ),
128128 )
129129 s_data = pd .DataFrame (s_data , index = data .index , columns = data .columns )
130130
@@ -282,10 +282,11 @@ def combat( # noqa: PLR0915
282282 bayesdata = bayesdata * np .sqrt (var_pooled ) + stand_mean
283283
284284 # put back into the adata object or return
285+ x = bayesdata .to_numpy ().transpose ()
285286 if inplace :
286- adata .X = bayesdata . to_numpy (). transpose ()
287+ adata .X = x
287288 return None
288- return bayesdata . to_numpy (). transpose ()
289+ return x
289290
290291
291292def _it_sol (
You can’t perform that action at this time.
0 commit comments