From 353059f30b1c8cf79500efe4a5feb1d86cb17168 Mon Sep 17 00:00:00 2001 From: Caibin Sheng Date: Sun, 26 May 2024 22:05:47 +0200 Subject: [PATCH] feat: add functionality for batch ambient removal --- scar/main/_scar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scar/main/_scar.py b/scar/main/_scar.py index 5654a91..ecf1ef7 100644 --- a/scar/main/_scar.py +++ b/scar/main/_scar.py @@ -301,7 +301,7 @@ def __init__( # add a mapper to locate the batch id self.batch_id = torch.from_numpy(batch_id_per_cell).int().to(self.device) - self.n_batch = batch_id.unique().size()[0] + self.n_batch = np.unique(batch_id_per_cell).size # get ambient profile from AnnData.uns elif (ambient_profile is None) and ("ambient_profile_all" in raw_count.uns):