Hi scuttle team,
I have found an issue with scuttle::aggregateAcrossCells() . Trying to pseudobulk a SpatialExperiment object on a single variable in colData results in the error Error in .local(x, ..., value) : New 'sample_id's must map uniquely.
The traceback() on this error is unhelpful, and the error message leaves me unsure of what to change.
However if I convert the object to a SingleCellExperiment the function runs as expected.
library("spatialLIBD")
library("scuttle")
spe <- fetch_data("spe")
class(spe)
# [1] "SpatialExperiment"
table(spe$spatialLIBD)
# L1 L2 L3 L4 L5 L6 WM
# 5322 2858 17587 3547 7300 6201 4514
spe_pseudo <- scuttle::aggregateAcrossCells(spe, id = spe$spatialLIBD)
# Error in .local(x, ..., value) : New 'sample_id's must map uniquely
## conver to single cell
spatialCoords(spe) <- NULL
imgData(spe) <- NULL
spe <- as(spe, "SingleCellExperiment")
## runs successfully
spe_pseudo <- scuttle::aggregateAcrossCells(spe, id = spe$spatialLIBD)
Hi scuttle team,
I have found an issue with
scuttle::aggregateAcrossCells(). Trying to pseudobulk aSpatialExperimentobject on a single variable in colData results in the errorError in .local(x, ..., value) : New 'sample_id's must map uniquely.The traceback() on this error is unhelpful, and the error message leaves me unsure of what to change.
However if I convert the object to a
SingleCellExperimentthe function runs as expected.