Skip to content

Commit 8bee571

Browse files
committed
Fixed pp pseudobulk bug when empty rows
1 parent 49e4ca6 commit 8bee571

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/decoupler/pp/anndata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ def pseudobulk(
318318
# Validate
319319
assert isinstance(adata, AnnData), 'adata must be an AnnData instance'
320320
assert isinstance(sample_col, str), 'sample_col must be a str'
321-
assert isinstance(groups_col, str) or groups_col is None, 'sample_col must be str or None'
321+
assert isinstance(groups_col, (str, list)) or groups_col is None, 'groups_col must be str or None'
322322
assert isinstance(mode, (str, dict)) or callable(mode), 'mode must be str, dict or callable'
323323
# Extract data
324-
X, _, var = extract(adata, layer=layer, raw=raw, empty=empty, verbose=verbose)
325-
obs = adata.obs.copy()
324+
X, obs, var = extract(adata, layer=layer, raw=raw, empty=empty, verbose=verbose)
325+
obs = adata.obs.loc[obs].copy()
326326
var = adata.var.loc[var]
327327
# Validate X
328328
_validate_X(X=X, mode=mode, skip_checks=skip_checks)

0 commit comments

Comments
 (0)