Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
galaxyeee opened this issue Feb 3, 2023 · 2 comments

Comments

@galaxyeee
Copy link

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
Copy link
Collaborator

LTLA commented Feb 4, 2023

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:

  • Save brca.sce to file with saveRDS(), load it in a new session with readRDS(), and see if scoreMarkers works there. This will determine whether other packages like Seurat (or its dependencies) are interfering with my imports.
  • Separately, just try library(S4Vectors) and see if scoreMarkers works. This will force S4Vectors::match into the global namespace, so maybe it might get picked up inside scoreMarkers. Maybe.

@galaxyeee
Copy link
Author

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

Best,
EUNHA

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

No branches or pull requests

2 participants