MarcElosua / SPOTlight

Spatial Transcriptomics Capture Location Deconvolution
https://marcelosua.github.io/SPOTlight
GNU General Public License v3.0
164 stars 25 forks source link

Error slot %in% SummarizedExperiment::assayNames(x) is not TRUE #85

Closed williamsdrake closed 10 months ago

williamsdrake commented 1 year ago

Hi SPOTlight team,

I'm having an issue with following the steps of the vignette on bioconductor. I've got to the point where I'm ready to run the SPOTlight function, but am getting this error. Note: sce and spe are my own single cell objects, I just kept the name the same as in the vignette for convenience.

> res <- SPOTlight(
+     x = sce,
+     y = spe,
+     groups = as.character(sce$generalCellTypes),
+     slot = "counts",
+     mgs = mgs_df,
+     hvg = hvg,
+     weight_id = "mean.AUC",
+     group_id = "cluster",
+     gene_id = "gene")
Error in .extract_counts(y, assay, slot) : 
  slot %in% SummarizedExperiment::assayNames(x) is not TRUE
> traceback()
5: stop(simpleError(msg, call = if (p <- sys.parent(1L)) sys.call(p)))
4: stopifnot(!is.null(SummarizedExperiment::assayNames(x)), slot %in% 
       SummarizedExperiment::assayNames(x), !is.null(colnames(x)))
3: .extract_counts(y, assay, slot)
2: trainNMF(x, y, groups, mgs, n_top, gene_id, group_id, weight_id, 
       hvg, model, scale, verbose, ...)
1: SPOTlight(x = sce, y = spe, groups = as.character(sce$generalCellTypes), 
       slot = "counts", mgs = mgs_df, hvg = hvg, weight_id = "mean.AUC", 
       group_id = "cluster", gene_id = "gene")

Traceback indicates the issue is that the slot name passed from the function is not one of the assays in the sce object, however it is/should be

> "counts" %in% SummarizedExperiment::assayNames(sce)
[1] TRUE

Any ideas what's going on here? Thanks

MarcElosua commented 1 year ago

Hi @williamsdrake,

Thank you very much for your interest in SPOTlight and your thorough debugging already!

One thing I think could be worth checking is if the slot counts is present in spe. If that doesn't work, you can also pass directly the count matrices to x & y which would circumvent the need to call .extract_counts.

Let me know if this helps!

carlosccfraga commented 1 year ago

I am having the same problem. I did everything I could and didnt work. Please check it.

HelenaLC commented 1 year ago

Could u print both the single call and spatial data object?