ZJUFanLab/scCATCH

Invalid times argument

hayfre opened this issue · 2 comments

Hi, I am receiving an error message when I try to run the following:

findmarkergenes(seurat_neuronal, species = 'Mouse', cluster = 'All', match_CellMatch = TRUE, cancer = NULL, tissue = 'Brain', cell_min_pct = 0.25, logfc = 0.25, pvalue = 0.05)

The readout:

Note: the raw data matrix includes 60671 cells and 23433 genes.

---Revising gene symbols according to NCBI Gene symbols (updated in June 19, 2020, https://www.ncbi.nlm.nih.gov/gene) and no matched genes and duplicated genes will be removed.

Note: the new data matrix includes 60671 cells and 21351 genes.

Note: there are 3644 potential marker genes in CellMatch database for Mouse on Brain.
Error in rep(clu_num[i], (length(clu_num) - 1)) :
invalid 'times' argument

I have already read and tried implementing issues #12 with no luck. I would appreciate any help to figure out what the problem is!

Hello, could you please check and show me the Idents(seurat_neuronal), which should be a factor containing cluster number for each cell.

Hi! Thanks for your comment. It made me realize that I needed to manually set the cluster identity, as it seems to have gotten lost when converting from an anndata object to a seurat object. I updated based on this: https://rdrr.io/github/satijalab/seurat/man/Idents.html

# Set idents from a value in object metadata colnames(x = seurat_neuronal[[]]) Idents(object = seurat_neuronal) <- 'louvain1' levels(x = seurat_neuronal)

where louvain1 is a factor containing the cluster numbers.

This gives the output:

Idents(object = seurat_neuronal) <- 'louvain1'
levels(x = seurat_neuronal)
[1] "0" "1" "2" "3" "9" "10" "11" "12" "13" "14" "16" "17" "18" "19" "21" "22" "23" "25" "26" "27"
[21] "29" "33" "34" "35" "36" "38"

Now the following findmarkergenes step seems to be working fine with no error message.