ZJUFanLab / scCATCH

Automatic Annotation on Cell Types of Clusters from Single-Cell RNA Sequencing Data
https://www.sciencedirect.com/science/article/pii/S2589004220300663
GNU General Public License v3.0
217 stars 38 forks source link

Error in genedata1$Var1 : $ operator is invalid for atomic vectors #32

Closed wolf5996 closed 3 years ago

wolf5996 commented 3 years ago

This issue was raised before #6, but the author closed it. They said that writing the arguments of the function correctly (capitalization) fixes the error. However, I keep getting this error with the following code: clu_markers <- scCATCH::findmarkergenes(object = HCC1806I, species = "Human", cluster = "All", match_CellMatch = F)

I am pretty sure all of the arguments have been inputed correctly. Does scCATCH work with ENSEMBL gene ids or do I have gene symbols?

wolf5996 commented 3 years ago

I looked into the underlying code for the findmarkergenes() function, and I have identified the cause of the error. In my Seurat object, my gene names were ensembl ids, which do not work with scCATCH. The gene names need to be gene symbols instead for the findmarkergenes() function to work.

preetida commented 3 years ago

I have the same issue, my seurat object have ensemble ids instead of gene names. Is there any work around it? for using scCATCH for such object.

wolf5996 commented 3 years ago

@preetida I haven't used scCATCH further because, unfortunately, it doesn't apply to my cell line dataset. However, after searching around, the best option for you is to convert your ensembl ids to gene symbols before creating the Seurat object. Once you create the Seurat object, you will find it very difficult to change the ensembl gene ids to gene names within the object itself (https://github.com/satijalab/seurat/issues/2865).

Therefore, you are better off using gene symbols from the get-go; You will lose some genes/features during id conversion but these are usually pseudogenes or long non-coding RNAs that will likey have no influence on your downstream analysis.