MarioniLab / scran

Clone of the Bioconductor repository for the scran package.
https://bioconductor.org/packages/devel/bioc/html/scran.html
39 stars 23 forks source link

Error in FUN(x, table, nomatch = nomatch, incomparables = incomparables) : 'match' requires vector arguments #108

Open galaxyeee opened 1 year ago

galaxyeee commented 1 year ago

Dear SCRAN developers,

Hello, I am writing an issue because I have a questions.

genes <- !grepl(pattern = "^Rp[l|s]|Mt", x = rownames(brca.sce)) I converted the single cell seurat object as a reference into a SingleCellExperiment object (-> brca.sce) and used that data to save the "genes".

mgs <- scoreMarkers(brca.sce, subset.row = genes) After going through the scoremarkers function, this error occurred.

Error in FUN(x, table, nomatch = nomatch, incomparables = incomparables) : 
  'match' requires vector arguments

5. FUN(x, table, nomatch = nomatch, incomparables = incomparables)
4. match(desired.comparisons, averaged.comparisons)
3. match(desired.comparisons, averaged.comparisons)
2. .cross_reference_to_desired(pre.ave$averaged.comparisons, desired.comparisons, collapse.symmetric = collapse.symmetric)
1. scoreMarkers(brca.sce, row.data = genes, groups = brca.sce$celltype_major)

I would really appreciate it if you let me know if there is a solution. Thank you!

Best, EUNHA

LTLA commented 1 year ago

Hm. Well, nothing particular comes to mind; everything seems to work in the following example.

library(scRNAseq)
sce <- ZeiselBrainData()
colLabels(sce) <- sce$level1class

library(scuttle)
sce <- logNormCounts(sce) # to get some log-counts
genes <- !grepl(pattern = "^Rp[l|s]|Mt", x = rownames(sce))
res <- scoreMarkers(sce, subset.row = genes)

It seems that, for some reason, S4Vectors::match is not being properly imported, leading to the observed error. No idea why, as I very explicitly import that match function when loading scran. I'd suggest two experiments:

galaxyeee commented 1 year ago

Hi, @LTLA Thanks to you, I solved problem! Thank you.

Best, EUNHA

RaquelGRubio commented 1 month ago

Hi @galaxyeee , I'm having the same problem, I have tried both solutions that @LTLA gives to you but can't solve it. Please, could you tell me how do you solved it?

Thank you very very much!! Kind regards,

Raquel