Skip to content

edit scuttle to scrapper for aggregateAcrossCells() - #123

Merged
lcolladotor merged 3 commits into
develfrom
scuttle_pseudobulk_check
Sep 28, 2026
Merged

lcolladotor merged 3 commits into
develfrom
scuttle_pseudobulk_check

Conversation

@manishabarse

@manishabarse manishabarse commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

We noticed that the package test was breaking [here] after the warning message:

Warning in .local(x, ...) : 'aggregateAcrossCells' is deprecated.

The aggregateAcrossCells() function in the scuttle package is being phased out in favor of the new scrapper package ([scuttle issue #36](LTLA/scuttle#36 (comment))) and has also been replaced in recent Bioconductor updates, such as in imcRtools ([Bioconductor 3.23 Release]. Additionally, internal arguments such as average have been deprecated in favor of statistics link.

Implementation

The initial implementation directly replaced scuttle::aggregateAcrossCells() with scrapper::aggregateAcrossCells(). However, the two functions work differently.

scuttle::aggregateAcrossCells() accepts a SingleCellExperiment and returns a SingleCellExperiment, while the scrapper::aggregateAcrossCells() implementation currently available to us operates on a matrix-like input and returns a list containing the aggregated counts and grouping information (sums, detected, combinations, counts, and index).

Therefore, directly passing the SingleCellExperiment to scrapper::aggregateAcrossCells() resulted in:

Error in dim(x) <- length(x) : invalid first argument, must be vector (list or atomic)

The implementation was updated to aggregate the counts matrix with scrapper::aggregateAcrossCells() and reconstruct the SingleCellExperiment. The original colData is also reconstructed, preserving the original column types and retaining the grouping variables (registration_variable, registration_sample_id) and ncells, to reproduce the structure of the previous scuttle output.

Validation

The updated registration_pseudobulk() implementation was tested against the previous scuttle implementation using the same example. The resulting SingleCellExperiment objects are now identical using:

testthat::expect_identical(sce_pseudo, test_pseudo) and testthat::expect_equal(sce_pseudo, test_pseudo).

@Nick-Eagles and @lahuuki helped to test this.

@lcolladotor
lcolladotor merged commit a4005a2 into devel Sep 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants