xuranw / MuSiC

Multi-subject Single Cell Deconvolution
https://github.com/xuranw/MuSiC
GNU General Public License v3.0
220 stars 83 forks source link

Error in Sigma[m.ids, ] : incorrect number of dimensions #109

Open Jiangmeling opened 1 year ago

Jiangmeling commented 1 year ago

est = music2_prop_t_statistics(bulk.control.mtx = bulk.control.mtx, bulk.case.mtx = bulk.case.mtx, sc.sce = sce, clusters = 'celltype', samples = 'identity', select.ct = 'CD28') Error in Sigma[m.ids, ] : incorrect number of dimensions

str(sce) ...............

..@ colData :Formal class 'DFrame' [package "S4Vectors"] with 6 slots .. .. ..@ rownames : chr [1:29974] "sc09_AAACCCAAGTAGTGCG-1" "sc09_AAACCCACATGTAACC-1" "sc09_AAACCCAGTAGGCTCC-1" "sc09_AAACGAATCATCTCTA-1" ... .. .. ..@ nrows : int 29974 .. .. ..@ listData :List of 2 .. .. .. ..$ celltype: Factor w/ 13 levels "CD28","CTLs",..: 1 1 3 4 10 3 10 3 3 3 ... .. .. .. .. ..- attr(, "names")= chr [1:29974] "sc09_AAACGAATCGCTCTAC-1" "sc09_AAACGCTCACCGTGCA-1" "sc09_AAAGAACAGGAAGTGA-1" "sc09_AAAGAACCACGGCGTT-1" ... .. .. .. ..$ identity: Factor w/ 9 levels "AC.sc10","AC.sc12",..: 6 6 6 6 6 6 6 6 6 6 ... .. .. .. .. ..- attr(, "names")= chr [1:29974] "sc09_AAACGAATCGCTCTAC-1" "sc09_AAACGCTCACCGTGCA-1" "sc09_AAAGAACAGGAAGTGA-1" "sc09_AAAGAACCACGGCGTT-1" ... .. .. ..@ elementType : chr "ANY" .. .. ..@ elementMetadata: NULL .. .. ..@ metadata : list()

I think it might be the cause of "attr(*, "names")", but trying to fix it hasn't solved it yet. I wonder if anyone has similar problems. I hope you can get an answer, thanks!

jsha129 commented 1 year ago

I solved this by adding more than one celltype. select.ct = c('CD28', 'CD138)

This is because R automatically coverts a matrix into a vector when selecting only one column. little annoying!