Error from `.extract_counts()` when calling `SeuratObject::GetAssayData()` v5.0.1
WuyangFF95 opened this issue · 1 comments
WuyangFF95 commented
Dear @MarcElosua.
In the line 10 of SPOTlight:::.extract_counts()
, you called function
x <- as.matrix(SeuratObject::GetAssayData(x, slot, assay))
However the v5.0.1 version of SeuratObject::GetAssayData()
has deprecated the selection of specific slot. Instead, they had the syntax below, layer
replaces slot
:
## S3 method for class 'Seurat'
GetAssayData(object, assay = NULL, layer = NULL, slot = deprecated(), ...)
This will break the function call of SPOTlight::SPOTlight()
with the following error.
Error in SeuratObject::GetAssayData(x, slot, assay) :
`assay` must be one of "RNA" or "SCT", not "scale.data".
In addition, SeuratObject uses LayerData()
to supercede GetAssayData()
. Thus the best replacement would be:
- Check version of SeuratObject.
- If >5.0.1, call
x <- as.matrix(SeuratObject::LayerData(x, layer = slot, assay = assay))
; otherwise, callx <- as.matrix(SeuratObject::GetAssayData(x, slot = slot, assay = assay))
Can you help me to fix this issue? Thanks!
MarcElosua commented
Duplicated here - #91 (comment)