dviraran / SingleR

SingleR: Single-cell RNA-seq cell types Recognition (legacy version)
GNU General Public License v3.0
263 stars 98 forks source link

Error when naming annot data #76

Closed Zepeng-Mu closed 5 years ago

Zepeng-Mu commented 5 years ago

Hi, I am using CreateSinglerSeuratObject() function and got the following error:

Error in names(orig.ident) <- colnames(counts) : 'names' attribute [4074] must be the same length as the vector [8]

I checked the code and the error seems to come from this line:

https://github.com/dviraran/SingleR/blob/4bb890a9b89b284c65f89a0c74fb00c6cc2c3367/R/SingleR.Create.R#L264

I do not know how to solve this issue. However, if I run is.null(names(seuratDt@meta.data)), I get FALSE. So I am not sure why the above line is still run. Secondly, names(seuratDt@meta.data) returns column names in the data frame, whereas colnames(count) returns cell barcode. So that is why I got the error above (I have 4074 cells, and my metadata has 8 columns).

Is there any way to solve this?

Many thanks

Zepeng-Mu commented 5 years ago

Well, I just saw this similar issue here:

67

This is a little bit confusing because in the help document it says annot can be txt file or a data frame. Closing this